Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
622a0ee5
Kaydet (Commit)
622a0ee5
authored
Mar 26, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move this into a real method also.
üst
0087946d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
153 additions
and
147 deletions
+153
-147
cuitabline.hxx
cui/source/inc/cuitabline.hxx
+1
-0
tpline.cxx
cui/source/tabpages/tpline.cxx
+152
-147
No files found.
cui/source/inc/cuitabline.hxx
Dosyayı görüntüle @
622a0ee5
...
@@ -197,6 +197,7 @@ private:
...
@@ -197,6 +197,7 @@ private:
sal_Bool
FillXLSet_Impl
();
sal_Bool
FillXLSet_Impl
();
#endif
#endif
void
InitSymbols
(
MenuButton
*
pButton
);
void
SymbolSelected
(
MenuButton
*
pButton
);
void
SymbolSelected
(
MenuButton
*
pButton
);
void
FillListboxes
();
void
FillListboxes
();
public
:
public
:
...
...
cui/source/tabpages/tpline.cxx
Dosyayı görüntüle @
622a0ee5
...
@@ -265,6 +265,157 @@ void SvxLineTabPage::Construct()
...
@@ -265,6 +265,157 @@ void SvxLineTabPage::Construct()
FillListboxes
();
FillListboxes
();
}
}
void
SvxLineTabPage
::
InitSymbols
(
MenuButton
*
pButton
)
{
//Popup initialisieren
if
(
!
pButton
->
GetPopupMenu
()
->
GetPopupMenu
(
MN_GALLERY
))
{
// Gallery-Eintraege besorgen
GalleryExplorer
::
FillObjList
(
GALLERY_THEME_BULLETS
,
aGrfNames
);
PopupMenu
*
pPopup
=
new
PopupMenu
;
rtl
::
OUString
aEmptyStr
;
const
rtl
::
OUString
*
pUIName
=
NULL
;
sal_uInt32
i
=
0
;
for
(
std
::
vector
<
rtl
::
OUString
>::
iterator
it
=
aGrfNames
.
begin
();
it
!=
aGrfNames
.
end
();
++
it
,
++
i
)
{
pUIName
=
&
(
*
it
);
// convert URL encodings to UI characters (eg %20 for spaces)
rtl
::
OUString
aPhysicalName
;
if
(
utl
::
LocalFileHelper
::
ConvertURLToPhysicalName
(
*
it
,
aPhysicalName
))
{
pUIName
=
&
aPhysicalName
;
}
SvxBrushItem
*
pBrushItem
=
new
SvxBrushItem
(
*
it
,
aEmptyStr
,
GPOS_AREA
,
SID_ATTR_BRUSH
);
pBrushItem
->
SetDoneLink
(
STATIC_LINK
(
this
,
SvxLineTabPage
,
GraphicArrivedHdl_Impl
));
SvxBmpItemInfo
*
pInfo
=
new
SvxBmpItemInfo
();
pInfo
->
pBrushItem
=
pBrushItem
;
pInfo
->
nItemId
=
(
sal_uInt16
)(
MN_GALLERY_ENTRY
+
i
);
if
(
i
<
aGrfBrushItems
.
size
()
)
{
aGrfBrushItems
.
insert
(
aGrfBrushItems
.
begin
()
+
i
,
pInfo
);
}
else
{
aGrfBrushItems
.
push_back
(
pInfo
);
}
const
Graphic
*
pGraphic
=
pBrushItem
->
GetGraphic
();
if
(
pGraphic
)
{
Bitmap
aBitmap
(
pGraphic
->
GetBitmap
());
Size
aSize
(
aBitmap
.
GetSizePixel
());
if
(
aSize
.
Width
()
>
MAX_BMP_WIDTH
||
aSize
.
Height
()
>
MAX_BMP_HEIGHT
)
{
sal_Bool
bWidth
=
aSize
.
Width
()
>
aSize
.
Height
();
double
nScale
=
bWidth
?
(
double
)
MAX_BMP_WIDTH
/
(
double
)
aSize
.
Width
()
:
(
double
)
MAX_BMP_HEIGHT
/
(
double
)
aSize
.
Height
();
aBitmap
.
Scale
(
nScale
,
nScale
);
}
Image
aImage
(
aBitmap
);
pPopup
->
InsertItem
(
pInfo
->
nItemId
,
*
pUIName
,
aImage
);
}
else
{
Image
aImage
;
pPopup
->
InsertItem
(
pInfo
->
nItemId
,
*
pUIName
,
aImage
);
}
}
aSymbolMB
.
GetPopupMenu
()
->
SetPopupMenu
(
MN_GALLERY
,
pPopup
);
if
(
aGrfNames
.
empty
())
aSymbolMB
.
GetPopupMenu
()
->
EnableItem
(
MN_GALLERY
,
sal_False
);
}
if
(
!
pButton
->
GetPopupMenu
()
->
GetPopupMenu
(
MN_SYMBOLS
)
&&
pSymbolList
)
{
VirtualDevice
aVDev
;
aVDev
.
SetMapMode
(
MapMode
(
MAP_100TH_MM
));
SdrModel
*
pModel
=
new
SdrModel
(
NULL
,
NULL
,
LOADREFCOUNTS
);
pModel
->
GetItemPool
().
FreezeIdRanges
();
// Page
SdrPage
*
pPage
=
new
SdrPage
(
*
pModel
,
sal_False
);
pPage
->
SetSize
(
Size
(
1000
,
1000
));
pModel
->
InsertPage
(
pPage
,
0
);
// 3D View
SdrView
*
pView
=
new
SdrView
(
pModel
,
&
aVDev
);
pView
->
hideMarkHandles
();
pView
->
ShowSdrPage
(
pPage
);
PopupMenu
*
pPopup
=
new
PopupMenu
;
rtl
::
OUString
aEmptyStr
;
// Generate invisible square to give all symbols a
// bitmap size, which is indepedent from specific glyph
SdrObject
*
pInvisibleSquare
=
pSymbolList
->
GetObj
(
0
);
pInvisibleSquare
=
pInvisibleSquare
->
Clone
();
pPage
->
NbcInsertObject
(
pInvisibleSquare
);
pInvisibleSquare
->
SetMergedItem
(
XFillTransparenceItem
(
100
));
pInvisibleSquare
->
SetMergedItem
(
XLineTransparenceItem
(
100
));
for
(
long
i
=
0
;;
++
i
)
{
SdrObject
*
pObj
=
pSymbolList
->
GetObj
(
i
);
if
(
pObj
==
NULL
)
break
;
pObj
=
pObj
->
Clone
();
aGrfNames
.
push_back
(
aEmptyStr
);
pPage
->
NbcInsertObject
(
pObj
);
if
(
pSymbolAttr
)
{
pObj
->
SetMergedItemSet
(
*
pSymbolAttr
);
}
else
{
pObj
->
SetMergedItemSet
(
rOutAttrs
);
}
pView
->
MarkAll
();
Bitmap
aBitmap
(
pView
->
GetAllMarkedBitmap
());
GDIMetaFile
aMeta
(
pView
->
GetAllMarkedMetaFile
());
pView
->
UnmarkAll
();
pObj
=
pPage
->
RemoveObject
(
1
);
SdrObject
::
Free
(
pObj
);
SvxBrushItem
*
pBrushItem
=
new
SvxBrushItem
(
Graphic
(
aMeta
),
GPOS_AREA
,
SID_ATTR_BRUSH
);
pBrushItem
->
SetDoneLink
(
STATIC_LINK
(
this
,
SvxLineTabPage
,
GraphicArrivedHdl_Impl
));
SvxBmpItemInfo
*
pInfo
=
new
SvxBmpItemInfo
();
pInfo
->
pBrushItem
=
pBrushItem
;
pInfo
->
nItemId
=
(
sal_uInt16
)(
MN_GALLERY_ENTRY
+
i
+
nNumMenuGalleryItems
);
if
(
(
size_t
)(
nNumMenuGalleryItems
+
i
)
<
aGrfBrushItems
.
size
()
)
{
aGrfBrushItems
.
insert
(
aGrfBrushItems
.
begin
()
+
nNumMenuGalleryItems
+
i
,
pInfo
);
}
else
{
aGrfBrushItems
.
push_back
(
pInfo
);
}
Size
aSize
(
aBitmap
.
GetSizePixel
());
if
(
aSize
.
Width
()
>
MAX_BMP_WIDTH
||
aSize
.
Height
()
>
MAX_BMP_HEIGHT
)
{
sal_Bool
bWidth
=
aSize
.
Width
()
>
aSize
.
Height
();
double
nScale
=
bWidth
?
(
double
)
MAX_BMP_WIDTH
/
(
double
)
aSize
.
Width
()
:
(
double
)
MAX_BMP_HEIGHT
/
(
double
)
aSize
.
Height
();
aBitmap
.
Scale
(
nScale
,
nScale
);
}
Image
aImage
(
aBitmap
);
pPopup
->
InsertItem
(
pInfo
->
nItemId
,
aEmptyStr
,
aImage
);
}
pInvisibleSquare
=
pPage
->
RemoveObject
(
0
);
SdrObject
::
Free
(
pInvisibleSquare
);
aSymbolMB
.
GetPopupMenu
()
->
SetPopupMenu
(
MN_SYMBOLS
,
pPopup
);
if
(
aGrfNames
.
empty
())
aSymbolMB
.
GetPopupMenu
()
->
EnableItem
(
MN_SYMBOLS
,
sal_False
);
delete
pView
;
delete
pModel
;
}
}
void
SvxLineTabPage
::
SymbolSelected
(
MenuButton
*
pButton
)
void
SvxLineTabPage
::
SymbolSelected
(
MenuButton
*
pButton
)
{
{
sal_uInt16
nItemId
=
pButton
->
GetCurItemId
();
sal_uInt16
nItemId
=
pButton
->
GetCurItemId
();
...
@@ -1553,153 +1704,7 @@ void SvxLineTabPage::FillUserData()
...
@@ -1553,153 +1704,7 @@ void SvxLineTabPage::FillUserData()
//der folgende Link stammt urspruenglich aus SvxNumOptionsTabPage
//der folgende Link stammt urspruenglich aus SvxNumOptionsTabPage
IMPL_LINK
(
SvxLineTabPage
,
MenuCreateHdl_Impl
,
MenuButton
*
,
pButton
)
IMPL_LINK
(
SvxLineTabPage
,
MenuCreateHdl_Impl
,
MenuButton
*
,
pButton
)
{
{
//Popup initialisieren
InitSymbols
(
pButton
);
if
(
!
pButton
->
GetPopupMenu
()
->
GetPopupMenu
(
MN_GALLERY
))
{
// Gallery-Eintraege besorgen
GalleryExplorer
::
FillObjList
(
GALLERY_THEME_BULLETS
,
aGrfNames
);
PopupMenu
*
pPopup
=
new
PopupMenu
;
rtl
::
OUString
aEmptyStr
;
const
rtl
::
OUString
*
pUIName
=
NULL
;
sal_uInt32
i
=
0
;
for
(
std
::
vector
<
rtl
::
OUString
>::
iterator
it
=
aGrfNames
.
begin
();
it
!=
aGrfNames
.
end
();
++
it
,
++
i
)
{
pUIName
=
&
(
*
it
);
// convert URL encodings to UI characters (eg %20 for spaces)
rtl
::
OUString
aPhysicalName
;
if
(
utl
::
LocalFileHelper
::
ConvertURLToPhysicalName
(
*
it
,
aPhysicalName
))
{
pUIName
=
&
aPhysicalName
;
}
SvxBrushItem
*
pBrushItem
=
new
SvxBrushItem
(
*
it
,
aEmptyStr
,
GPOS_AREA
,
SID_ATTR_BRUSH
);
pBrushItem
->
SetDoneLink
(
STATIC_LINK
(
this
,
SvxLineTabPage
,
GraphicArrivedHdl_Impl
));
SvxBmpItemInfo
*
pInfo
=
new
SvxBmpItemInfo
();
pInfo
->
pBrushItem
=
pBrushItem
;
pInfo
->
nItemId
=
(
sal_uInt16
)(
MN_GALLERY_ENTRY
+
i
);
if
(
i
<
aGrfBrushItems
.
size
()
)
{
aGrfBrushItems
.
insert
(
aGrfBrushItems
.
begin
()
+
i
,
pInfo
);
}
else
{
aGrfBrushItems
.
push_back
(
pInfo
);
}
const
Graphic
*
pGraphic
=
pBrushItem
->
GetGraphic
();
if
(
pGraphic
)
{
Bitmap
aBitmap
(
pGraphic
->
GetBitmap
());
Size
aSize
(
aBitmap
.
GetSizePixel
());
if
(
aSize
.
Width
()
>
MAX_BMP_WIDTH
||
aSize
.
Height
()
>
MAX_BMP_HEIGHT
)
{
sal_Bool
bWidth
=
aSize
.
Width
()
>
aSize
.
Height
();
double
nScale
=
bWidth
?
(
double
)
MAX_BMP_WIDTH
/
(
double
)
aSize
.
Width
()
:
(
double
)
MAX_BMP_HEIGHT
/
(
double
)
aSize
.
Height
();
aBitmap
.
Scale
(
nScale
,
nScale
);
}
Image
aImage
(
aBitmap
);
pPopup
->
InsertItem
(
pInfo
->
nItemId
,
*
pUIName
,
aImage
);
}
else
{
Image
aImage
;
pPopup
->
InsertItem
(
pInfo
->
nItemId
,
*
pUIName
,
aImage
);
}
}
aSymbolMB
.
GetPopupMenu
()
->
SetPopupMenu
(
MN_GALLERY
,
pPopup
);
if
(
aGrfNames
.
empty
())
aSymbolMB
.
GetPopupMenu
()
->
EnableItem
(
MN_GALLERY
,
sal_False
);
}
if
(
!
pButton
->
GetPopupMenu
()
->
GetPopupMenu
(
MN_SYMBOLS
)
&&
pSymbolList
)
{
VirtualDevice
aVDev
;
aVDev
.
SetMapMode
(
MapMode
(
MAP_100TH_MM
));
SdrModel
*
pModel
=
new
SdrModel
(
NULL
,
NULL
,
LOADREFCOUNTS
);
pModel
->
GetItemPool
().
FreezeIdRanges
();
// Page
SdrPage
*
pPage
=
new
SdrPage
(
*
pModel
,
sal_False
);
pPage
->
SetSize
(
Size
(
1000
,
1000
));
pModel
->
InsertPage
(
pPage
,
0
);
// 3D View
SdrView
*
pView
=
new
SdrView
(
pModel
,
&
aVDev
);
pView
->
hideMarkHandles
();
pView
->
ShowSdrPage
(
pPage
);
PopupMenu
*
pPopup
=
new
PopupMenu
;
rtl
::
OUString
aEmptyStr
;
// Generate invisible square to give all symbols a
// bitmap size, which is indepedent from specific glyph
SdrObject
*
pInvisibleSquare
=
pSymbolList
->
GetObj
(
0
);
pInvisibleSquare
=
pInvisibleSquare
->
Clone
();
pPage
->
NbcInsertObject
(
pInvisibleSquare
);
pInvisibleSquare
->
SetMergedItem
(
XFillTransparenceItem
(
100
));
pInvisibleSquare
->
SetMergedItem
(
XLineTransparenceItem
(
100
));
for
(
long
i
=
0
;;
++
i
)
{
SdrObject
*
pObj
=
pSymbolList
->
GetObj
(
i
);
if
(
pObj
==
NULL
)
break
;
pObj
=
pObj
->
Clone
();
aGrfNames
.
push_back
(
aEmptyStr
);
pPage
->
NbcInsertObject
(
pObj
);
if
(
pSymbolAttr
)
{
pObj
->
SetMergedItemSet
(
*
pSymbolAttr
);
}
else
{
pObj
->
SetMergedItemSet
(
rOutAttrs
);
}
pView
->
MarkAll
();
Bitmap
aBitmap
(
pView
->
GetAllMarkedBitmap
());
GDIMetaFile
aMeta
(
pView
->
GetAllMarkedMetaFile
());
pView
->
UnmarkAll
();
pObj
=
pPage
->
RemoveObject
(
1
);
SdrObject
::
Free
(
pObj
);
SvxBrushItem
*
pBrushItem
=
new
SvxBrushItem
(
Graphic
(
aMeta
),
GPOS_AREA
,
SID_ATTR_BRUSH
);
pBrushItem
->
SetDoneLink
(
STATIC_LINK
(
this
,
SvxLineTabPage
,
GraphicArrivedHdl_Impl
));
SvxBmpItemInfo
*
pInfo
=
new
SvxBmpItemInfo
();
pInfo
->
pBrushItem
=
pBrushItem
;
pInfo
->
nItemId
=
(
sal_uInt16
)(
MN_GALLERY_ENTRY
+
i
+
nNumMenuGalleryItems
);
if
(
(
size_t
)(
nNumMenuGalleryItems
+
i
)
<
aGrfBrushItems
.
size
()
)
{
aGrfBrushItems
.
insert
(
aGrfBrushItems
.
begin
()
+
nNumMenuGalleryItems
+
i
,
pInfo
);
}
else
{
aGrfBrushItems
.
push_back
(
pInfo
);
}
Size
aSize
(
aBitmap
.
GetSizePixel
());
if
(
aSize
.
Width
()
>
MAX_BMP_WIDTH
||
aSize
.
Height
()
>
MAX_BMP_HEIGHT
)
{
sal_Bool
bWidth
=
aSize
.
Width
()
>
aSize
.
Height
();
double
nScale
=
bWidth
?
(
double
)
MAX_BMP_WIDTH
/
(
double
)
aSize
.
Width
()
:
(
double
)
MAX_BMP_HEIGHT
/
(
double
)
aSize
.
Height
();
aBitmap
.
Scale
(
nScale
,
nScale
);
}
Image
aImage
(
aBitmap
);
pPopup
->
InsertItem
(
pInfo
->
nItemId
,
aEmptyStr
,
aImage
);
}
pInvisibleSquare
=
pPage
->
RemoveObject
(
0
);
SdrObject
::
Free
(
pInvisibleSquare
);
aSymbolMB
.
GetPopupMenu
()
->
SetPopupMenu
(
MN_SYMBOLS
,
pPopup
);
if
(
aGrfNames
.
empty
())
aSymbolMB
.
GetPopupMenu
()
->
EnableItem
(
MN_SYMBOLS
,
sal_False
);
delete
pView
;
delete
pModel
;
}
return
0
;
return
0
;
}
}
//#58425# Symbole auf einer Linie (z.B. StarChart)
//#58425# Symbole auf einer Linie (z.B. StarChart)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment