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
b1663b86
Kaydet (Commit)
b1663b86
authored
Tem 16, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
handle legend position combobox correctly
Change-Id: Ic19e8cd20d739761975db2b00cb92fd27f8ac4be
üst
9ce5cfff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
2 deletions
+96
-2
ChartElementsPanel.cxx
chart2/source/controller/sidebar/ChartElementsPanel.cxx
+87
-0
ChartElementsPanel.hxx
chart2/source/controller/sidebar/ChartElementsPanel.hxx
+3
-0
sidebarelements.ui
chart2/uiconfig/ui/sidebarelements.ui
+6
-2
No files found.
chart2/source/controller/sidebar/ChartElementsPanel.cxx
Dosyayı görüntüle @
b1663b86
...
...
@@ -20,6 +20,9 @@
#include <sfx2/sidebar/ResourceDefinitions.hrc>
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/ControlFactory.hxx>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include "ChartElementsPanel.hxx"
#include "ChartController.hxx"
#include <sfx2/bindings.hxx>
...
...
@@ -242,6 +245,77 @@ void setAxisVisible(css::uno::Reference<css::frame::XModel> xModel, AxisType eTy
}
}
sal_Int32
getLegendPos
(
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>
xModel
)
{
ChartModel
*
pModel
=
getChartModel
(
xModel
);
if
(
!
pModel
)
return
4
;
Reference
<
beans
::
XPropertySet
>
xLegendProp
(
LegendHelper
::
getLegend
(
*
pModel
),
uno
::
UNO_QUERY
);
if
(
!
xLegendProp
.
is
())
return
4
;
chart2
::
LegendPosition
eLegendPos
=
chart2
::
LegendPosition_CUSTOM
;
xLegendProp
->
getPropertyValue
(
"AnchorPosition"
)
>>=
eLegendPos
;
switch
(
eLegendPos
)
{
case
chart2
:
:
LegendPosition_LINE_START
:
return
1
;
case
chart2
:
:
LegendPosition_LINE_END
:
return
2
;
case
chart2
:
:
LegendPosition_PAGE_START
:
return
3
;
case
chart2
:
:
LegendPosition_PAGE_END
:
return
0
;
default
:
return
4
;
}
}
void
setLegendPos
(
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>
xModel
,
sal_Int32
nPos
)
{
ChartModel
*
pModel
=
getChartModel
(
xModel
);
if
(
!
pModel
)
return
;
Reference
<
beans
::
XPropertySet
>
xLegendProp
(
LegendHelper
::
getLegend
(
*
pModel
),
uno
::
UNO_QUERY
);
if
(
!
xLegendProp
.
is
())
return
;
chart2
::
LegendPosition
eLegendPos
=
chart2
::
LegendPosition_CUSTOM
;
css
::
chart
::
ChartLegendExpansion
eExpansion
=
css
::
chart
::
ChartLegendExpansion_HIGH
;
switch
(
nPos
)
{
case
3
:
eLegendPos
=
chart2
::
LegendPosition_PAGE_START
;
eExpansion
=
css
::
chart
::
ChartLegendExpansion_WIDE
;
break
;
case
1
:
eLegendPos
=
chart2
::
LegendPosition_LINE_START
;
break
;
case
2
:
eLegendPos
=
chart2
::
LegendPosition_LINE_END
;
break
;
case
0
:
eLegendPos
=
chart2
::
LegendPosition_PAGE_END
;
eExpansion
=
css
::
chart
::
ChartLegendExpansion_WIDE
;
break
;
case
4
:
eLegendPos
=
chart2
::
LegendPosition_CUSTOM
;
break
;
default
:
assert
(
false
);
}
xLegendProp
->
setPropertyValue
(
"AnchorPosition"
,
css
::
uno
::
makeAny
(
eLegendPos
));
xLegendProp
->
setPropertyValue
(
"Expansion"
,
css
::
uno
::
makeAny
(
eExpansion
));
if
(
eLegendPos
!=
chart2
::
LegendPosition_CUSTOM
)
{
xLegendProp
->
setPropertyValue
(
"RelativePosition"
,
uno
::
Any
());
}
}
}
ChartElementsPanel
::
ChartElementsPanel
(
...
...
@@ -274,6 +348,8 @@ ChartElementsPanel::ChartElementsPanel(
get
(
mpCBGridVerticalMinor
,
"checkbutton_gridline_vertical_minor"
);
get
(
mpCBGridHorizontalMinor
,
"checkbutton_gridline_horizontal_minor"
);
get
(
mpLBLegendPosition
,
"comboboxtext_legend"
);
Initialize
();
}
...
...
@@ -332,6 +408,8 @@ void ChartElementsPanel::Initialize()
mpCBGridHorizontalMajor
->
SetClickHdl
(
aLink
);
mpCBGridVerticalMinor
->
SetClickHdl
(
aLink
);
mpCBGridHorizontalMinor
->
SetClickHdl
(
aLink
);
mpLBLegendPosition
->
SetSelectHdl
(
LINK
(
this
,
ChartElementsPanel
,
LegendPosHdl
));
}
void
ChartElementsPanel
::
updateData
()
...
...
@@ -363,6 +441,8 @@ void ChartElementsPanel::updateData()
mpCBZAxis
->
Disable
();
mpCBZAxisTitle
->
Disable
();
}
mpLBLegendPosition
->
SelectEntryPos
(
getLegendPos
(
mxModel
));
}
VclPtr
<
vcl
::
Window
>
ChartElementsPanel
::
Create
(
...
...
@@ -454,6 +534,13 @@ IMPL_LINK(ChartElementsPanel, CheckBoxHdl, CheckBox*, pCheckBox)
return
0
;
}
IMPL_LINK_NOARG
(
ChartElementsPanel
,
LegendPosHdl
)
{
sal_Int32
nPos
=
mpLBLegendPosition
->
GetSelectEntryPos
();
setLegendPos
(
mxModel
,
nPos
);
return
0
;
}
}}
// end of namespace ::chart::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
chart2/source/controller/sidebar/ChartElementsPanel.hxx
Dosyayı görüntüle @
b1663b86
...
...
@@ -90,6 +90,8 @@ private:
VclPtr
<
CheckBox
>
mpCBGridVerticalMinor
;
VclPtr
<
CheckBox
>
mpCBGridHorizontalMinor
;
VclPtr
<
ListBox
>
mpLBLegendPosition
;
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
mxFrame
;
::
sfx2
::
sidebar
::
EnumContext
maContext
;
SfxBindings
*
mpBindings
;
...
...
@@ -100,6 +102,7 @@ private:
void
Initialize
();
DECL_LINK
(
CheckBoxHdl
,
CheckBox
*
);
DECL_LINK
(
LegendPosHdl
,
void
*
);
};
}
}
// end of namespace ::chart::sidebar
...
...
chart2/uiconfig/ui/sidebarelements.ui
Dosyayı görüntüle @
b1663b86
...
...
@@ -309,11 +309,15 @@
</packing>
</child>
<child>
<object
class=
"GtkComboBoxText"
id=
"comboboxtext
1
"
>
<object
class=
"GtkComboBoxText"
id=
"comboboxtext
_legend
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<items>
<item
translatable=
"yes"
>
bottom left
</item>
<item
translatable=
"yes"
>
Bottom
</item>
<item
translatable=
"yes"
>
Left
</item>
<item
translatable=
"yes"
>
Right
</item>
<item
translatable=
"yes"
>
Top
</item>
<item
translatable=
"yes"
>
Manual
</item>
</items>
</object>
<packing>
...
...
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