[Libreoffice-commits] core.git: Branch 'feature/chart-sidebar' - 54 commits - bin/find-unused-defines.awk bin/find-unused-defines.sh bin/gbuild-to-ide chart2/Library_chartcontroller.mk chart2/source comphelper/source config_host/config_version.h.in configure.ac connectivity/source dbaccess/source filter/source forms/source formula/source fpicker/source framework/inc framework/source idl/inc include/basic include/comphelper include/i18nlangtag include/sfx2 include/svx include/toolkit include/tools include/tubes include/ucbhelper io/test libreofficekit/qa offapi/com onlineupdate/source package/inc package/source postprocess/Rdb_services.mk pyuno/source sal/qa sax/test sc/inc scp2/inc sc/qa sc/source sd/source sfx2/source solenv/gdb starmath/source stoc/source svl/source svx/inc svx/Library_svx.mk svx/source sw/CppunitTest_sw_odfexport.mk sw/inc sw/qa sw/source toolkit/source ucb/source vcl/inc vcl/opengl vcl/source wizards/source writerfilter/source xmlhelp/source xmloff/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Wed Jul 29 15:25:14 PDT 2015
bin/find-unused-defines.awk | 2
bin/find-unused-defines.sh | 17
bin/gbuild-to-ide | 23
chart2/Library_chartcontroller.mk | 1
chart2/source/controller/sidebar/Chart2PanelFactory.cxx | 3
chart2/source/controller/sidebar/ChartAreaPanel.cxx | 60
chart2/source/controller/sidebar/ChartAreaPanel.hxx | 14
chart2/source/controller/sidebar/ChartLinePanel.cxx | 295 +++
chart2/source/controller/sidebar/ChartLinePanel.hxx | 104 +
chart2/source/inc/RegressionCalculationHelper.hxx | 4
chart2/source/model/main/DataPoint.cxx | 3
chart2/source/model/main/DataPointProperties.cxx | 67
chart2/source/tools/FillProperties.cxx | 31
chart2/source/tools/RegressionCurveCalculator.cxx | 4
comphelper/source/compare/AnyCompareFactory.cxx | 6
comphelper/source/container/IndexedPropertyValuesContainer.cxx | 74
comphelper/source/container/NamedPropertyValuesContainer.cxx | 80
comphelper/source/container/container.cxx | 22
comphelper/source/container/embeddedobjectcontainer.cxx | 14
comphelper/source/container/enumerablemap.cxx | 8
comphelper/source/container/namecontainer.cxx | 44
comphelper/source/eventattachermgr/eventattachermgr.cxx | 6
comphelper/source/misc/accessibletexthelper.cxx | 4
comphelper/source/misc/anycompare.cxx | 12
comphelper/source/misc/componentmodule.cxx | 2
comphelper/source/misc/configuration.cxx | 4
comphelper/source/misc/docpasswordhelper.cxx | 6
comphelper/source/misc/documentinfo.cxx | 4
comphelper/source/misc/documentiologring.hxx | 30
comphelper/source/misc/evtlistenerhlp.cxx | 6
comphelper/source/misc/instancelocker.hxx | 59
comphelper/source/misc/logging.cxx | 2
comphelper/source/misc/namedvaluecollection.cxx | 2
comphelper/source/misc/officerestartmanager.hxx | 28
comphelper/source/misc/scopeguard.cxx | 2
comphelper/source/misc/serviceinfohelper.cxx | 8
comphelper/source/misc/stillreadwriteinteraction.cxx | 2
comphelper/source/misc/storagehelper.cxx | 2
comphelper/source/misc/syntaxhighlight.cxx | 1
comphelper/source/officeinstdir/officeinstallationdirectories.hxx | 32
comphelper/source/property/ChainablePropertySet.cxx | 4
comphelper/source/property/ChainablePropertySetInfo.cxx | 6
comphelper/source/property/MasterPropertySet.cxx | 4
comphelper/source/property/MasterPropertySetInfo.cxx | 6
comphelper/source/property/genericpropertyset.cxx | 6
comphelper/source/property/opropertybag.hxx | 108 -
comphelper/source/property/propagg.cxx | 114 -
comphelper/source/property/propertysetinfo.cxx | 6
comphelper/source/property/propstate.cxx | 36
comphelper/source/streaming/memorystream.cxx | 4
comphelper/source/streaming/seqinputstreamserv.cxx | 18
comphelper/source/streaming/seqoutputstreamserv.cxx | 10
comphelper/source/streaming/seqstream.cxx | 2
comphelper/source/streaming/streamsection.cxx | 4
comphelper/source/xml/attributelist.cxx | 12
config_host/config_version.h.in | 3
configure.ac | 10
connectivity/source/drivers/mork/MNSFolders.cxx | 4
connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx | 7
dbaccess/source/core/dataaccess/intercept.cxx | 22
dbaccess/source/inc/apitools.hxx | 61
filter/source/msfilter/eschesdo.cxx | 20
filter/source/t602/t602filter.cxx | 12
forms/source/component/EditBase.hxx | 10
forms/source/component/clickableimage.hxx | 8
forms/source/inc/FormComponent.hxx | 24
forms/source/inc/property.hxx | 20
forms/source/richtext/richtextcontrol.cxx | 34
formula/source/ui/dlg/formula.cxx | 50
formula/source/ui/dlg/structpg.hxx | 2
fpicker/source/office/iodlg.cxx | 6
framework/inc/macros/xinterface.hxx | 392 ----
framework/inc/macros/xtypeprovider.hxx | 358 ---
framework/source/uielement/subtoolbarcontroller.cxx | 2
idl/inc/globals.hxx | 14
include/basic/sbxcore.hxx | 16
include/comphelper/classids.hxx | 54
include/i18nlangtag/lang.h | 11
include/sfx2/childwin.hxx | 8
include/sfx2/sfxuno.hxx | 26
include/svx/drawitem.hxx | 26
include/svx/sidebar/AreaPropertyPanelBase.hxx | 14
include/svx/sidebar/LinePropertyPanelBase.hxx | 171 +
include/svx/sidebar/LineWidthPopup.hxx | 50
include/svx/xtable.hxx | 52
include/toolkit/helper/macros.hxx | 68
include/tools/diagnose_ex.h | 20
include/tools/pstm.hxx | 13
include/tools/rtti.hxx | 7
include/tools/stream.hxx | 6
include/tubes/file-transfer-helper.h | 8
include/ucbhelper/macros.hxx | 47
io/test/stm/testfactreg.hxx | 8
libreofficekit/qa/data/calc_sheetnames.ods |binary
libreofficekit/qa/unit/tiledrendering.cxx | 24
offapi/com/sun/star/chart2/DataPointProperties.idl | 10
onlineupdate/source/update/updater/nsWindowsRestart.cxx | 6
package/inc/ZipOutputEntry.hxx | 15
package/source/zipapi/ZipOutputEntry.cxx | 50
package/source/zippackage/ZipPackageStream.cxx | 2
postprocess/Rdb_services.mk | 9
pyuno/source/module/pyuno.cxx | 95 -
pyuno/source/module/pyuno_adapter.cxx | 27
pyuno/source/module/pyuno_impl.hxx | 9
pyuno/source/module/pyuno_module.cxx | 4
pyuno/source/module/pyuno_runtime.cxx | 22
sal/qa/osl/condition/osl_Condition_Const.h | 5
sax/test/sax/factory.hxx | 8
sc/inc/docuno.hxx | 3
sc/inc/simpleformulacalc.hxx | 3
sc/qa/unit/ucalc.cxx | 29
sc/qa/unit/ucalc.hxx | 4
sc/qa/unit/ucalc_formula.cxx | 167 +
sc/source/core/data/simpleformulacalc.cxx | 23
sc/source/ui/formdlg/formula.cxx | 2
sc/source/ui/unoobj/docuno.cxx | 8
scp2/inc/macros.inc | 39
sd/source/ui/app/menuids_tmpl.src | 8
sd/source/ui/app/tbxids_tmpl.src | 8
sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx | 3
sd/source/ui/remotecontrol/mDNSResponder/DebugServices.h | 3
sfx2/source/toolbox/tbxitem.cxx | 4
solenv/gdb/libreoffice/sw.py | 2
starmath/source/smdetect.hxx | 12
stoc/source/inspect/introspection.cxx | 193 +-
stoc/source/invocation/invocation.cxx | 50
svl/source/inc/poolio.hxx | 40
svl/source/items/poolio.cxx | 25
svx/Library_svx.mk | 1
svx/inc/globlmn_tmpl.hrc | 26
svx/source/sidebar/area/AreaPropertyPanel.hxx | 16
svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 15
svx/source/sidebar/line/LinePropertyPanel.cxx | 825 --------
svx/source/sidebar/line/LinePropertyPanel.hxx | 77
svx/source/sidebar/line/LinePropertyPanelBase.cxx | 919 ++++++++++
svx/source/sidebar/line/LineWidthControl.cxx | 12
svx/source/sidebar/line/LineWidthControl.hxx | 7
svx/source/sidebar/line/LineWidthPopup.cxx | 5
svx/source/sidebar/line/LineWidthPopup.hxx | 50
sw/CppunitTest_sw_odfexport.mk | 6
sw/inc/pch/precompiled_sw.hxx | 1
sw/qa/extras/odfexport/data/oooxml_embedded.sxw |binary
sw/qa/extras/odfexport/odfexport.cxx | 36
sw/qa/extras/uiwriter/uiwriter.cxx | 42
sw/source/core/doc/DocumentLinksAdministrationManager.cxx | 3
sw/source/core/doc/docsort.cxx | 14
sw/source/core/inc/blink.hxx | 17
sw/source/core/text/blink.cxx | 41
sw/source/filter/html/htmlatr.cxx | 54
sw/source/filter/html/wrthtml.cxx | 8
sw/source/filter/html/wrthtml.hxx | 18
sw/source/filter/ww8/ww8scan.cxx | 9
sw/source/ui/dialog/uiregionsw.cxx | 10
sw/source/ui/misc/num.cxx | 1
sw/source/uibase/inc/regionsw.hxx | 7
sw/source/uibase/inc/swvset.hxx | 32
toolkit/source/awt/vclxwindow.cxx | 25
toolkit/source/helper/listenermultiplexer.cxx | 31
ucb/source/core/provprox.cxx | 5
ucb/source/core/provprox.hxx | 6
ucb/source/core/ucb.cxx | 8
ucb/source/ucp/ftp/ftpurl.cxx | 12
ucb/source/ucp/hierarchy/hierarchycontent.cxx | 6
ucb/source/ucp/hierarchy/hierarchycontent.hxx | 9
ucb/source/ucp/hierarchy/hierarchydatasource.cxx | 8
ucb/source/ucp/hierarchy/hierarchyprovider.cxx | 2
ucb/source/ucp/hierarchy/hierarchyprovider.hxx | 3
ucb/source/ucp/package/pkgcontent.cxx | 4
ucb/source/ucp/package/pkgcontent.hxx | 8
ucb/source/ucp/package/pkgprovider.cxx | 2
ucb/source/ucp/package/pkgprovider.hxx | 5
ucb/source/ucp/tdoc/tdoc_content.cxx | 8
ucb/source/ucp/tdoc/tdoc_content.hxx | 12
ucb/source/ucp/webdav/DAVResourceAccess.hxx | 2
ucb/source/ucp/webdav/DateTimeHelper.cxx | 26
ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx | 2
ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx | 2
ucb/source/ucp/webdav/SerfRequestProcessor.cxx | 16
ucb/source/ucp/webdav/SerfSession.cxx | 16
ucb/source/ucp/webdav/SerfSession.hxx | 4
ucb/source/ucp/webdav/SerfUri.cxx | 2
ucb/source/ucp/webdav/webdavcontent.cxx | 6
ucb/source/ucp/webdav/webdavdatasupplier.cxx | 2
ucb/source/ucp/webdav/webdavprovider.cxx | 2
ucb/source/ucp/webdav/webdavresponseparser.cxx | 9
ucb/source/ucp/webdav/webdavservices.cxx | 3
vcl/inc/unx/gtk/gloactiongroup.h | 6
vcl/opengl/README.opengl | 26
vcl/source/filter/jpeg/jinclude.h | 9
wizards/source/access2base/CommandBarControl.xba | 9
writerfilter/source/dmapper/DomainMapper.cxx | 8
writerfilter/source/dmapper/DomainMapper.hxx | 6
xmlhelp/source/cxxhelp/provider/content.cxx | 3
xmlhelp/source/cxxhelp/provider/content.hxx | 4
xmloff/source/text/txtexppr.cxx | 43
195 files changed, 3295 insertions(+), 3321 deletions(-)
New commits:
commit e0648253ad608880106ca073f40fed29b3b4791f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 29 23:18:44 2015 +0200
also handle line width correctly
Change-Id: Ia564d3c9b821a09586a0bcb32ee3f827e71f43de
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx
index a4ad08f..d677e20 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx
@@ -154,6 +154,7 @@ void ChartLinePanel::Initialize()
if (xSelectionSupplier.is())
xSelectionSupplier->addSelectionChangeListener(mxSelectionListener.get());
+ setMapUnit(SFX_MAPUNIT_100TH_MM);
updateData();
}
diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx
index 63f5d93..ef5bfa3 100644
--- a/include/svx/sidebar/LinePropertyPanelBase.hxx
+++ b/include/svx/sidebar/LinePropertyPanelBase.hxx
@@ -108,6 +108,8 @@ protected:
void SelectEndStyle(bool bStart);
void SelectLineStyle();
+ void setMapUnit(SfxMapUnit eMapUnit);
+
private:
//ui controls
VclPtr<FixedText> mpFTWidth;
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index f898c37..66c4565 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -100,6 +100,7 @@ void LinePropertyPanel::dispose()
void LinePropertyPanel::Initialize()
{
+ setMapUnit(maWidthControl.GetCoreMetric());
}
VclPtr<vcl::Window> LinePropertyPanel::Create (
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 443c47f..707d9ce 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -216,8 +216,6 @@ void LinePropertyPanelBase::Initialize()
mpIMGWidthIcon[6] = Image(SVX_RES(IMG_WIDTH7_ICON));
mpIMGWidthIcon[7] = Image(SVX_RES(IMG_WIDTH8_ICON));
- // meMapUnit = maWidthControl.GetCoreMetric();
-
FillLineStyleList();
SelectLineStyle();
Link<> aLink = LINK( this, LinePropertyPanelBase, ChangeLineStyleHdl );
@@ -911,6 +909,11 @@ void LinePropertyPanelBase::SelectEndStyle(bool bStart)
}
}
+void LinePropertyPanelBase::setMapUnit(SfxMapUnit eMapUnit)
+{
+ meMapUnit = eMapUnit;
+}
+
}} // end of namespace svx::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 52db1e70a151bf94a86c7969c15f6c438a135b81
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 29 15:33:57 2015 +0200
handle line dash in chart line panel
Change-Id: Ia3d466c269eef62f8fa419d15869f44213a6e001
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx
index b78e0c5..a4ad08f 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx
@@ -16,6 +16,7 @@
#include <svx/xlinjoit.hxx>
#include <svx/xlndsit.hxx>
#include <svx/xlntrit.hxx>
+#include <svx/unomid.hxx>
#include <com/sun/star/view/XSelectionSupplier.hpp>
@@ -61,6 +62,24 @@ css::uno::Reference<css::beans::XPropertySet> getPropSet(
return xPropSet;
}
+css::uno::Any getLineDash(
+ css::uno::Reference<css::frame::XModel> xModel, const OUString& rDashName)
+{
+ css::uno::Reference<css::lang::XMultiServiceFactory> xFact(xModel, css::uno::UNO_QUERY);
+ css::uno::Reference<css::container::XNameAccess> xNameAccess(
+ xFact->createInstance("com.sun.star.drawing.DashTable"),
+ css::uno::UNO_QUERY );
+ if(xNameAccess.is())
+ {
+ if (!xNameAccess->hasByName(rDashName))
+ return css::uno::Any();
+
+ return xNameAccess->getByName(rDashName);
+ }
+
+ return css::uno::Any();
+}
+
class PreventUpdate
{
public:
@@ -147,6 +166,23 @@ void ChartLinePanel::updateData()
if (!xPropSet.is())
return;
+ sal_uInt16 nLineTransparence = 0;
+ xPropSet->getPropertyValue("LineTransparence") >>= nLineTransparence;
+ XLineTransparenceItem aLineTransparenceItem(nLineTransparence);
+ updateLineTransparence(false, true, &aLineTransparenceItem);
+
+ css::drawing::LineStyle eStyle = css::drawing::LineStyle_SOLID;
+ xPropSet->getPropertyValue("LineStyle") >>= eStyle;
+ XLineStyleItem aStyleItem(eStyle);
+ updateLineStyle(false, true, &aStyleItem);
+
+ css::uno::Any aLineDashName = xPropSet->getPropertyValue("LineDashName");
+ OUString aDashName;
+ aLineDashName >>= aDashName;
+ css::uno::Any aLineDash = getLineDash(mxModel, aDashName);
+ XLineDashItem aDashItem;
+ aDashItem.PutValue(aLineDash, MID_LINEDASH);
+ updateLineDash(false, true, &aDashItem);
}
void ChartLinePanel::modelInvalid()
@@ -198,7 +234,13 @@ void ChartLinePanel::setLineDash(const XLineDashItem& rItem)
if (!xPropSet.is())
return;
- xPropSet->setPropertyValue("LineDash", css::uno::makeAny(rItem.GetValue()));
+ css::uno::Any aAny;
+ rItem.QueryValue(aAny, MID_LINEDASH);
+ OUString aDashName = PropertyHelper::addLineDashUniqueNameToTable(aAny,
+ css::uno::Reference<css::lang::XMultiServiceFactory>(mxModel, css::uno::UNO_QUERY),
+ "");
+ xPropSet->setPropertyValue("LineDash", aAny);
+ xPropSet->setPropertyValue("LineDashName", css::uno::makeAny(aDashName));
}
void ChartLinePanel::setLineEndStyle(const XLineEndItem* /*pItem*/)
commit 8aaa7db74a080b4bceee46b48118ce20b1f5327c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 29 15:33:18 2015 +0200
it is insane to not map line and border properties to the same id
Change-Id: I6f4eb2509dc731cb281350b2bb0cce94b66a8ad6
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index ed35733..f09cf47 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -177,21 +177,21 @@ void DataPointProperties::AddPropertiesToVector(
rOutProperties.push_back(
Property( "BorderStyle",
- PROP_DATAPOINT_BORDER_STYLE,
+ LinePropertiesHelper::PROP_LINE_STYLE,
cppu::UnoType<drawing::LineStyle>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
Property( "BorderWidth",
- PROP_DATAPOINT_BORDER_WIDTH,
+ LinePropertiesHelper::PROP_LINE_WIDTH,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
Property( "BorderDashName",
- PROP_DATAPOINT_BORDER_DASH_NAME,
+ LinePropertiesHelper::PROP_LINE_DASH_NAME,
cppu::UnoType<OUString>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
commit ea220ea2dc381d7f6ce60c8fc314c4a74ee2eb42
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 29 03:16:13 2015 +0200
set some properties from chart line panel
Change-Id: Idbe26d7ea554512391b22299ac6dccaeaa71d584
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx
index 26736d3..b78e0c5 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx
@@ -12,6 +12,11 @@
#include "PropertyHelper.hxx"
#include "ChartController.hxx"
+#include <svx/xlnwtit.hxx>
+#include <svx/xlinjoit.hxx>
+#include <svx/xlndsit.hxx>
+#include <svx/xlntrit.hxx>
+
#include <com/sun/star/view/XSelectionSupplier.hpp>
namespace chart { namespace sidebar {
@@ -174,12 +179,26 @@ void ChartLinePanel::updateModel(
xSelectionSupplier->addSelectionChangeListener(mxSelectionListener.get());
}
-void ChartLinePanel::setLineStyle(const XLineStyleItem& /*rItem*/)
+void ChartLinePanel::setLineStyle(const XLineStyleItem& rItem)
{
+ css::uno::Reference<css::beans::XPropertySet> xPropSet =
+ getPropSet(mxModel);
+
+ if (!xPropSet.is())
+ return;
+
+ xPropSet->setPropertyValue("LineStyle", css::uno::makeAny(rItem.GetValue()));
}
-void ChartLinePanel::setLineDash(const XLineDashItem& /*rItem*/)
+void ChartLinePanel::setLineDash(const XLineDashItem& rItem)
{
+ css::uno::Reference<css::beans::XPropertySet> xPropSet =
+ getPropSet(mxModel);
+
+ if (!xPropSet.is())
+ return;
+
+ xPropSet->setPropertyValue("LineDash", css::uno::makeAny(rItem.GetValue()));
}
void ChartLinePanel::setLineEndStyle(const XLineEndItem* /*pItem*/)
@@ -190,20 +209,42 @@ void ChartLinePanel::setLineStartStyle(const XLineStartItem* /*pItem*/)
{
}
-void ChartLinePanel::setLineJoint(const XLineJointItem* /*pItem*/)
+void ChartLinePanel::setLineJoint(const XLineJointItem* pItem)
{
+ css::uno::Reference<css::beans::XPropertySet> xPropSet =
+ getPropSet(mxModel);
+
+ if (!xPropSet.is())
+ return;
+
+ if (pItem)
+ xPropSet->setPropertyValue("LineJoint", css::uno::makeAny(pItem->GetValue()));
}
void ChartLinePanel::setLineCap(const XLineCapItem* /*pItem*/)
{
}
-void ChartLinePanel::setLineTransparency(const XLineTransparenceItem& /*rItem*/)
+void ChartLinePanel::setLineTransparency(const XLineTransparenceItem& rItem)
{
+ css::uno::Reference<css::beans::XPropertySet> xPropSet =
+ getPropSet(mxModel);
+
+ if (!xPropSet.is())
+ return;
+
+ xPropSet->setPropertyValue("LineTransparence", css::uno::makeAny(rItem.GetValue()));
}
-void ChartLinePanel::setLineWidth(const XLineWidthItem& /*rItem*/)
+void ChartLinePanel::setLineWidth(const XLineWidthItem& rItem)
{
+ css::uno::Reference<css::beans::XPropertySet> xPropSet =
+ getPropSet(mxModel);
+
+ if (!xPropSet.is())
+ return;
+
+ xPropSet->setPropertyValue("LineWidth", css::uno::makeAny(rItem.GetValue()));
}
} }
commit 185cf738a0cc44f54594f71ca15926efd9275665
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 29 03:15:40 2015 +0200
provide also LineTransparence for DataPointProperties
Change-Id: I9c3e547831d3d876c228c8b9b566f17a4d95ce5b
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index 064261d..ed35733 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -174,24 +174,28 @@ void DataPointProperties::AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID // "maybe auto"
| beans::PropertyAttribute::MAYBEDEFAULT ));
+
rOutProperties.push_back(
Property( "BorderStyle",
PROP_DATAPOINT_BORDER_STYLE,
cppu::UnoType<drawing::LineStyle>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
+
rOutProperties.push_back(
Property( "BorderWidth",
PROP_DATAPOINT_BORDER_WIDTH,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
+
rOutProperties.push_back(
Property( "BorderDashName",
PROP_DATAPOINT_BORDER_DASH_NAME,
cppu::UnoType<OUString>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
+
rOutProperties.push_back(
Property( "BorderTransparency",
PROP_DATAPOINT_BORDER_TRANSPARENCY,
@@ -206,18 +210,21 @@ void DataPointProperties::AddPropertiesToVector(
cppu::UnoType<drawing::LineStyle>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
+
rOutProperties.push_back(
Property( "LineWidth",
LinePropertiesHelper::PROP_LINE_WIDTH,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
+
rOutProperties.push_back(
Property( "LineDash",
LinePropertiesHelper::PROP_LINE_DASH,
cppu::UnoType<drawing::LineDash>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
+
rOutProperties.push_back(
Property( "LineDashName",
LinePropertiesHelper::PROP_LINE_DASH_NAME,
@@ -225,6 +232,13 @@ void DataPointProperties::AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
+ rOutProperties.push_back(
+ Property( "LineTransparence",
+ PROP_DATAPOINT_BORDER_TRANSPARENCY,
+ cppu::UnoType<sal_Int16>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEVOID ));
+
// FillProperties
// bitmap properties
rOutProperties.push_back(
commit 73dbaaa11dd6a708350f992e241d3e6d7186e3a7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 29 02:46:50 2015 +0200
provide structure for chart line panel
Change-Id: I75204a012e4bc59f40a06db814bb9057a1cf8598
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index 2e03a7e..1dbb89a 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -192,6 +192,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/sidebar/ChartAxisPanel \
chart2/source/controller/sidebar/ChartElementsPanel \
chart2/source/controller/sidebar/ChartErrorBarPanel \
+ chart2/source/controller/sidebar/ChartLinePanel \
chart2/source/controller/sidebar/ChartSeriesPanel \
chart2/source/controller/sidebar/ChartSidebarModifyListener \
chart2/source/controller/sidebar/ChartSidebarSelectionListener \
diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
index d45ad84..97a96db 100644
--- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
+++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
@@ -35,6 +35,7 @@
#include "ChartAxisPanel.hxx"
#include "ChartErrorBarPanel.hxx"
#include "ChartAreaPanel.hxx"
+#include "ChartLinePanel.hxx"
using namespace css::uno;
using ::rtl::OUString;
@@ -99,6 +100,8 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
pPanel = ChartErrorBarPanel::Create(pParentWindow, xFrame, pController);
else if (rsResourceURL.endsWith("/AreaPanel"))
pPanel = ChartAreaPanel::Create(pParentWindow, xFrame, pController);
+ else if (rsResourceURL.endsWith("/LinePanel"))
+ pPanel = ChartLinePanel::Create(pParentWindow, xFrame, pController);
if (pPanel)
xElement = sfx2::sidebar::SidebarPanelBase::Create(
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx
new file mode 100644
index 0000000..26736d3
--- /dev/null
+++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx
@@ -0,0 +1,211 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "ChartLinePanel.hxx"
+
+#include "PropertyHelper.hxx"
+#include "ChartController.hxx"
+
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+
+namespace chart { namespace sidebar {
+
+namespace {
+
+OUString getCID(css::uno::Reference<css::frame::XModel> xModel)
+{
+ css::uno::Reference<css::frame::XController> xController(xModel->getCurrentController());
+ css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(xController, css::uno::UNO_QUERY);
+ if (!xSelectionSupplier.is())
+ return OUString();
+
+ css::uno::Any aAny = xSelectionSupplier->getSelection();
+ if (!aAny.hasValue())
+ return OUString();
+
+ OUString aCID;
+ aAny >>= aCID;
+
+ return aCID;
+}
+
+css::uno::Reference<css::beans::XPropertySet> getPropSet(
+ css::uno::Reference<css::frame::XModel> xModel)
+{
+ OUString aCID = getCID(xModel);
+ css::uno::Reference<css::beans::XPropertySet> xPropSet =
+ ObjectIdentifier::getObjectPropertySet(aCID, xModel);
+
+ ObjectType eType = ObjectIdentifier::getObjectType(aCID);
+ if (eType == OBJECTTYPE_DIAGRAM)
+ {
+ css::uno::Reference<css::chart2::XDiagram> xDiagram(
+ xPropSet, css::uno::UNO_QUERY);
+ if (!xDiagram.is())
+ return xPropSet;
+
+ xPropSet.set(xDiagram->getWall());
+ }
+
+ return xPropSet;
+}
+
+class PreventUpdate
+{
+public:
+ PreventUpdate(bool& bUpdate):
+ mbUpdate(bUpdate)
+ {
+ mbUpdate = false;
+ }
+
+ ~PreventUpdate()
+ {
+ mbUpdate = true;
+ }
+
+private:
+ bool& mbUpdate;
+};
+
+}
+
+VclPtr<vcl::Window> ChartLinePanel::Create(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ ChartController* pController)
+{
+ if (pParent == NULL)
+ throw css::lang::IllegalArgumentException("no parent Window given to ChartAxisPanel::Create", NULL, 0);
+ if (!rxFrame.is())
+ throw css::lang::IllegalArgumentException("no XFrame given to ChartAxisPanel::Create", NULL, 1);
+
+ return VclPtr<ChartLinePanel>::Create(
+ pParent, rxFrame, pController);
+}
+
+ChartLinePanel::ChartLinePanel(vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ ChartController* pController):
+ svx::sidebar::LinePropertyPanelBase(pParent, rxFrame),
+ mxModel(pController->getModel()),
+ mxListener(new ChartSidebarModifyListener(this)),
+ mxSelectionListener(new ChartSidebarSelectionListener(this)),
+ mbUpdate(true)
+{
+ std::vector<ObjectType> aAcceptedTypes { OBJECTTYPE_PAGE, OBJECTTYPE_DIAGRAM, OBJECTTYPE_DATA_SERIES, OBJECTTYPE_TITLE, OBJECTTYPE_LEGEND};
+ mxSelectionListener->setAcceptedTypes(aAcceptedTypes);
+ Initialize();
+}
+
+ChartLinePanel::~ChartLinePanel()
+{
+ disposeOnce();
+}
+
+void ChartLinePanel::dispose()
+{
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcaster->removeModifyListener(mxListener);
+
+ css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
+ if (xSelectionSupplier.is())
+ xSelectionSupplier->removeSelectionChangeListener(mxSelectionListener.get());
+
+ LinePropertyPanelBase::dispose();
+}
+
+void ChartLinePanel::Initialize()
+{
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcaster->addModifyListener(mxListener);
+
+ css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
+ if (xSelectionSupplier.is())
+ xSelectionSupplier->addSelectionChangeListener(mxSelectionListener.get());
+
+ updateData();
+}
+
+void ChartLinePanel::updateData()
+{
+ if (!mbUpdate)
+ return;
+
+ css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(mxModel);
+ if (!xPropSet.is())
+ return;
+
+}
+
+void ChartLinePanel::modelInvalid()
+{
+}
+
+void ChartLinePanel::selectionChanged(bool bCorrectType)
+{
+ if (bCorrectType)
+ updateData();
+}
+
+void ChartLinePanel::SelectionInvalid()
+{
+}
+
+void ChartLinePanel::updateModel(
+ css::uno::Reference<css::frame::XModel> xModel)
+{
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcaster->removeModifyListener(mxListener);
+
+ mxModel = xModel;
+
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcasterNew(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcasterNew->addModifyListener(mxListener);
+
+ css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
+ if (xSelectionSupplier.is())
+ xSelectionSupplier->addSelectionChangeListener(mxSelectionListener.get());
+}
+
+void ChartLinePanel::setLineStyle(const XLineStyleItem& /*rItem*/)
+{
+}
+
+void ChartLinePanel::setLineDash(const XLineDashItem& /*rItem*/)
+{
+}
+
+void ChartLinePanel::setLineEndStyle(const XLineEndItem* /*pItem*/)
+{
+}
+
+void ChartLinePanel::setLineStartStyle(const XLineStartItem* /*pItem*/)
+{
+}
+
+void ChartLinePanel::setLineJoint(const XLineJointItem* /*pItem*/)
+{
+}
+
+void ChartLinePanel::setLineCap(const XLineCapItem* /*pItem*/)
+{
+}
+
+void ChartLinePanel::setLineTransparency(const XLineTransparenceItem& /*rItem*/)
+{
+}
+
+void ChartLinePanel::setLineWidth(const XLineWidthItem& /*rItem*/)
+{
+}
+
+} }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.hxx b/chart2/source/controller/sidebar/ChartLinePanel.hxx
new file mode 100644
index 0000000..a2b2ea5
--- /dev/null
+++ b/chart2/source/controller/sidebar/ChartLinePanel.hxx
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_SIDEBAR_CHARTLINEPANEL_HXX
+#define INCLUDED_CHART2_SOURCE_CONTROLLER_SIDEBAR_CHARTLINEPANEL_HXX
+
+#include <vcl/ctrl.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <sfx2/sidebar/SidebarModelUpdate.hxx>
+#include <svx/xgrad.hxx>
+#include <svx/itemwin.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xflclit.hxx>
+#include <svx/xflgrit.hxx>
+#include <svx/xflhtit.hxx>
+#include <svx/xbtmpit.hxx>
+#include <svx/drawitem.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
+#include <svl/intitem.hxx>
+#include <com/sun/star/ui/XUIElement.hpp>
+#include <boost/scoped_ptr.hpp>
+
+#include <svx/sidebar/LinePropertyPanelBase.hxx>
+
+#include "ChartSidebarModifyListener.hxx"
+#include "ChartSidebarSelectionListener.hxx"
+
+class XFillFloatTransparenceItem;
+class XFillTransparenceItem;
+class XFillStyleItem;
+class XFillGradientItem;
+class XFillColorItem;
+class XFillHatchItem;
+class XFillBitmapItem;
+
+namespace chart {
+
+class ChartController;
+
+namespace sidebar {
+
+class ChartLinePanel : public svx::sidebar::LinePropertyPanelBase,
+ public sfx2::sidebar::SidebarModelUpdate,
+ public ChartSidebarModifyListenerParent,
+ public ChartSidebarSelectionListenerParent
+{
+public:
+ static VclPtr<vcl::Window> Create(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ ChartController* pController);
+
+ // constructor/destuctor
+ ChartLinePanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ ChartController* pController);
+
+ virtual ~ChartLinePanel();
+
+ virtual void updateData() SAL_OVERRIDE;
+ virtual void modelInvalid() SAL_OVERRIDE;
+
+ virtual void selectionChanged(bool bCorrectType) SAL_OVERRIDE;
+ virtual void SelectionInvalid() SAL_OVERRIDE;
+
+ virtual void dispose() SAL_OVERRIDE;
+
+ virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) SAL_OVERRIDE;
+
+ virtual void setLineWidth(const XLineWidthItem& rItem) SAL_OVERRIDE;
+
+protected:
+
+ virtual void setLineStyle(const XLineStyleItem& rItem) SAL_OVERRIDE;
+ virtual void setLineDash(const XLineDashItem& rItem) SAL_OVERRIDE;
+ virtual void setLineEndStyle(const XLineEndItem* pItem) SAL_OVERRIDE;
+ virtual void setLineStartStyle(const XLineStartItem* pItem) SAL_OVERRIDE;
+ virtual void setLineTransparency(const XLineTransparenceItem& rItem) SAL_OVERRIDE;
+ virtual void setLineJoint(const XLineJointItem* pItem) SAL_OVERRIDE;
+ virtual void setLineCap(const XLineCapItem* pItem) SAL_OVERRIDE;
+
+private:
+
+ css::uno::Reference<css::frame::XModel> mxModel;
+ css::uno::Reference<css::util::XModifyListener> mxListener;
+ rtl::Reference<ChartSidebarSelectionListener> mxSelectionListener;
+
+ void Initialize();
+
+ bool mbUpdate;
+};
+
+} } // end of namespace svx::sidebar
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx
similarity index 98%
rename from svx/source/sidebar/line/LinePropertyPanelBase.hxx
rename to include/svx/sidebar/LinePropertyPanelBase.hxx
index 656496c..63f5d93 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.hxx
+++ b/include/svx/sidebar/LinePropertyPanelBase.hxx
@@ -29,6 +29,7 @@
#include <svx/sidebar/PanelLayout.hxx>
#include <svx/xtable.hxx>
#include "LineWidthPopup.hxx"
+#include <svx/svxdllapi.h>
class XLineStyleItem;
@@ -60,7 +61,7 @@ namespace sidebar
class PopupContainer;
class LineWidthControl;
-class LinePropertyPanelBase : public PanelLayout
+class SVX_DLLPUBLIC LinePropertyPanelBase : public PanelLayout
{
public:
virtual ~LinePropertyPanelBase();
diff --git a/svx/source/sidebar/line/LineWidthPopup.hxx b/include/svx/sidebar/LineWidthPopup.hxx
similarity index 100%
rename from svx/source/sidebar/line/LineWidthPopup.hxx
rename to include/svx/sidebar/LineWidthPopup.hxx
diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx
index dc05150..d9377d4 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.hxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.hxx
@@ -28,8 +28,7 @@
#include <memory>
#include <svx/sidebar/PanelLayout.hxx>
#include <svx/xtable.hxx>
-#include "LineWidthPopup.hxx"
-#include "LinePropertyPanelBase.hxx"
+#include <svx/sidebar/LinePropertyPanelBase.hxx>
class XLineStyleItem;
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 45d0ebd..443c47f 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -19,7 +19,7 @@
#include <sfx2/sidebar/ResourceDefinitions.hrc>
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/ControlFactory.hxx>
-#include <LinePropertyPanelBase.hxx>
+#include <svx/sidebar/LinePropertyPanelBase.hxx>
#include <LinePropertyPanel.hrc>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
diff --git a/svx/source/sidebar/line/LineWidthControl.cxx b/svx/source/sidebar/line/LineWidthControl.cxx
index 2bee185..4053c49 100644
--- a/svx/source/sidebar/line/LineWidthControl.cxx
+++ b/svx/source/sidebar/line/LineWidthControl.cxx
@@ -18,7 +18,7 @@
*/
#include "LineWidthControl.hxx"
#include "LinePropertyPanel.hrc"
-#include "LinePropertyPanelBase.hxx"
+#include <svx/sidebar/LinePropertyPanelBase.hxx>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
diff --git a/svx/source/sidebar/line/LineWidthPopup.cxx b/svx/source/sidebar/line/LineWidthPopup.cxx
index 968a58d..351d12d 100644
--- a/svx/source/sidebar/line/LineWidthPopup.cxx
+++ b/svx/source/sidebar/line/LineWidthPopup.cxx
@@ -16,9 +16,10 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "LineWidthPopup.hxx"
+#include <svx/sidebar/LineWidthPopup.hxx>
#include "LineWidthControl.hxx"
-#include "LinePropertyPanel.hxx"
+
+#include <svx/sidebar/LinePropertyPanelBase.hxx>
#include <unotools/viewoptions.hxx>
commit e5449d211ab005e163507902c4a482e33ae95e41
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Jul 28 18:52:30 2015 +0200
split the line width panel into two pieces
The new LinePropertyPanelBase has no reference to SfxBindings anymore.
Change-Id: I7d1d1bb351066dca8bfeedc559048f8337e47f67
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 339b502..6fcce69 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -192,6 +192,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/sidebar/shadow/ShadowPropertyPanel \
svx/source/sidebar/graphic/GraphicPropertyPanel \
svx/source/sidebar/line/LinePropertyPanel \
+ svx/source/sidebar/line/LinePropertyPanelBase \
svx/source/sidebar/line/LineWidthControl \
svx/source/sidebar/line/LineWidthValueSet \
svx/source/sidebar/line/LineWidthPopup \
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index faa5477..f898c37 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -55,102 +55,13 @@ using namespace css;
using namespace css::uno;
using sfx2::sidebar::Theme;
-const char UNO_SELECTWIDTH[] = ".uno:SelectWidth";
-
-namespace
-{
-
-void FillLineEndListBox(ListBox& rListBoxStart, ListBox& rListBoxEnd, const XLineEndList& rList)
-{
- const sal_uInt32 nCount(rList.Count());
- const OUString sNone(SVX_RESSTR(RID_SVXSTR_NONE));
-
- rListBoxStart.SetUpdateMode(false);
- rListBoxEnd.SetUpdateMode(false);
-
- rListBoxStart.Clear();
- rListBoxEnd.Clear();
-
- // add 'none' entries
- rListBoxStart.InsertEntry(sNone);
- rListBoxEnd.InsertEntry(sNone);
-
- for(sal_uInt32 i(0); i < nCount; i++)
- {
- XLineEndEntry* pEntry = rList.GetLineEnd(i);
- const Bitmap aBitmap = const_cast< XLineEndList& >(rList).GetUiBitmap(i);
-
- if(!aBitmap.IsEmpty())
- {
- Bitmap aCopyStart(aBitmap);
- Bitmap aCopyEnd(aBitmap);
-
- const Size aBmpSize(aCopyStart.GetSizePixel());
- const Rectangle aCropRectStart(Point(), Size(aBmpSize.Width() / 2, aBmpSize.Height()));
- const Rectangle aCropRectEnd(Point(aBmpSize.Width() / 2, 0), Size(aBmpSize.Width() / 2, aBmpSize.Height()));
-
- aCopyStart.Crop(aCropRectStart);
- rListBoxStart.InsertEntry(
- pEntry->GetName(),
- Image(aCopyStart));
-
- aCopyEnd.Crop(aCropRectEnd);
- rListBoxEnd.InsertEntry(
- pEntry->GetName(),
- Image(aCopyEnd));
- }
- else
- {
- rListBoxStart.InsertEntry(pEntry->GetName());
- rListBoxEnd.InsertEntry(pEntry->GetName());
- }
- }
-
- rListBoxStart.SetUpdateMode(true);
- rListBoxEnd.SetUpdateMode(true);
-}
-
-void FillLineStyleListBox(ListBox& rListBox, const XDashList& rList)
-{
- const sal_uInt32 nCount(rList.Count());
- rListBox.SetUpdateMode(false);
-
- rListBox.Clear();
-
- // entry for 'none'
- rListBox.InsertEntry(rList.GetStringForUiNoLine());
-
- // entry for solid line
- rListBox.InsertEntry(rList.GetStringForUiSolidLine(),
- Image( rList.GetBitmapForUISolidLine()));
-
- for(sal_uInt32 i(0); i < nCount; i++)
- {
- XDashEntry* pEntry = rList.GetDash(i);
- const Bitmap aBitmap = const_cast< XDashList& >(rList).GetUiBitmap(i);
-
- if(!aBitmap.IsEmpty())
- {
- rListBox.InsertEntry(pEntry->GetName(), Image(aBitmap));
- }
- else
- {
- rListBox.InsertEntry(pEntry->GetName());
- }
- }
-
- rListBox.SetUpdateMode(true);
-}
-
-} // end of anonymous namespace
-
namespace svx { namespace sidebar {
LinePropertyPanel::LinePropertyPanel(
vcl::Window* pParent,
const uno::Reference<frame::XFrame>& rxFrame,
SfxBindings* pBindings)
-: PanelLayout(pParent, "LinePropertyPanel", "svx/ui/sidebarline.ui", rxFrame),
+: LinePropertyPanelBase(pParent, rxFrame),
maStyleControl(SID_ATTR_LINE_STYLE, *pBindings, *this),
maDashControl (SID_ATTR_LINE_DASH, *pBindings, *this),
maWidthControl(SID_ATTR_LINE_WIDTH, *pBindings, *this),
@@ -161,34 +72,8 @@ LinePropertyPanel::LinePropertyPanel(
maTransControl(SID_ATTR_LINE_TRANSPARENCE, *pBindings, *this),
maEdgeStyle(SID_ATTR_LINE_JOINT, *pBindings, *this),
maCapStyle(SID_ATTR_LINE_CAP, *pBindings, *this),
- mpStyleItem(),
- mpDashItem(),
- mnTrans(0),
- meMapUnit(SFX_MAPUNIT_MM),
- mnWidthCoreValue(0),
- mpStartItem(),
- mpEndItem(),
- maLineWidthPopup(this, ::boost::bind(&LinePropertyPanel::CreateLineWidthPopupControl, this, _1)),
- maIMGNone(SVX_RES(IMG_NONE_ICON)),
- mpIMGWidthIcon(),
- mxFrame(rxFrame),
- mpBindings(pBindings),
- mbWidthValuable(true)
+ mpBindings(pBindings)
{
- get(mpFTWidth, "widthlabel");
- get(mpTBWidth, "width");
- get(mpFTStyle, "stylelabel");
- get(mpLBStyle, "linestyle");
- get(mpFTTransparency, "translabel");
- get(mpMFTransparent, "linetransparency");
- get(mpFTArrow, "arrowlabel");
- get(mpLBStart, "beginarrowstyle");
- get(mpLBEnd, "endarrowstyle");
- get(mpFTEdgeStyle, "cornerlabel");
- get(mpLBEdgeStyle, "edgestyle");
- get(mpFTCapStyle, "caplabel");
- get(mpLBCapStyle, "linecapstyle");
-
Initialize();
}
@@ -199,21 +84,6 @@ LinePropertyPanel::~LinePropertyPanel()
void LinePropertyPanel::dispose()
{
- mpFTWidth.clear();
- mpTBWidth.clear();
- mpFTStyle.clear();
- mpLBStyle.clear();
- mpFTTransparency.clear();
- mpMFTransparent.clear();
- mpFTArrow.clear();
- mpLBStart.clear();
- mpLBEnd.clear();
- mpFTEdgeStyle.clear();
- mpLBEdgeStyle.clear();
- mpFTCapStyle.clear();
- mpLBCapStyle.clear();
-
- maLineWidthPopup.dispose();
maStyleControl.dispose();
maDashControl.dispose();
maWidthControl.dispose();
@@ -225,66 +95,11 @@ void LinePropertyPanel::dispose()
maEdgeStyle.dispose();
maCapStyle.dispose();
- PanelLayout::dispose();
+ LinePropertyPanelBase::dispose();
}
void LinePropertyPanel::Initialize()
{
- mpIMGWidthIcon.reset(new Image[8]);
- mpIMGWidthIcon[0] = Image(SVX_RES(IMG_WIDTH1_ICON));
- mpIMGWidthIcon[1] = Image(SVX_RES(IMG_WIDTH2_ICON));
- mpIMGWidthIcon[2] = Image(SVX_RES(IMG_WIDTH3_ICON));
- mpIMGWidthIcon[3] = Image(SVX_RES(IMG_WIDTH4_ICON));
- mpIMGWidthIcon[4] = Image(SVX_RES(IMG_WIDTH5_ICON));
- mpIMGWidthIcon[5] = Image(SVX_RES(IMG_WIDTH6_ICON));
- mpIMGWidthIcon[6] = Image(SVX_RES(IMG_WIDTH7_ICON));
- mpIMGWidthIcon[7] = Image(SVX_RES(IMG_WIDTH8_ICON));
-
- meMapUnit = maWidthControl.GetCoreMetric();
-
- FillLineStyleList();
- SelectLineStyle();
- Link<> aLink = LINK( this, LinePropertyPanel, ChangeLineStyleHdl );
- mpLBStyle->SetSelectHdl( aLink );
- mpLBStyle->SetAccessibleName(OUString( "Style"));
- mpLBStyle->AdaptDropDownLineCountToMaximum();
-
- const sal_uInt16 nIdWidth = mpTBWidth->GetItemId(UNO_SELECTWIDTH);
- mpTBWidth->SetItemImage(nIdWidth, mpIMGWidthIcon[0]);
- mpTBWidth->SetItemBits( nIdWidth, mpTBWidth->GetItemBits( nIdWidth ) | ToolBoxItemBits::DROPDOWNONLY );
- Link<ToolBox *, void> aLink2 = LINK(this, LinePropertyPanel, ToolboxWidthSelectHdl);
- mpTBWidth->SetDropdownClickHdl ( aLink2 );
- mpTBWidth->SetSelectHdl ( aLink2 );
-
- FillLineEndList();
- SelectEndStyle(true);
- SelectEndStyle(false);
- aLink = LINK( this, LinePropertyPanel, ChangeStartHdl );
- mpLBStart->SetSelectHdl( aLink );
- mpLBStart->SetAccessibleName(OUString("Beginning Style")); //wj acc
- mpLBStart->AdaptDropDownLineCountToMaximum();
- aLink = LINK( this, LinePropertyPanel, ChangeEndHdl );
- mpLBEnd->SetSelectHdl( aLink );
- mpLBEnd->SetAccessibleName(OUString("Ending Style")); //wj acc
- mpLBEnd->AdaptDropDownLineCountToMaximum();
-
- aLink = LINK(this, LinePropertyPanel, ChangeTransparentHdl);
- mpMFTransparent->SetModifyHdl(aLink);
- mpMFTransparent->SetAccessibleName(OUString("Transparency")); //wj acc
-
- mpTBWidth->SetAccessibleRelationLabeledBy(mpFTWidth);
- mpLBStyle->SetAccessibleRelationLabeledBy(mpFTStyle);
- mpMFTransparent->SetAccessibleRelationLabeledBy(mpFTTransparency);
- mpLBStart->SetAccessibleRelationLabeledBy(mpFTArrow);
- mpLBEnd->SetAccessibleRelationLabeledBy(mpLBEnd);
-
- aLink = LINK( this, LinePropertyPanel, ChangeEdgeStyleHdl );
- mpLBEdgeStyle->SetSelectHdl( aLink );
- mpLBEdgeStyle->SetAccessibleName(OUString("Corner Style"));
-
- aLink = LINK( this, LinePropertyPanel, ChangeCapStyleHdl );
- mpLBCapStyle->SetSelectHdl( aLink );
- mpLBCapStyle->SetAccessibleName(OUString("Cap Style"));
}
VclPtr<vcl::Window> LinePropertyPanel::Create (
@@ -302,10 +117,6 @@ VclPtr<vcl::Window> LinePropertyPanel::Create (
return VclPtr<LinePropertyPanel>::Create(pParent, rxFrame, pBindings);
}
-void LinePropertyPanel::DataChanged(const DataChangedEvent& /*rEvent*/)
-{
-}
-
void LinePropertyPanel::NotifyItemUpdate(
sal_uInt16 nSID,
SfxItemState eState,
@@ -313,174 +124,44 @@ void LinePropertyPanel::NotifyItemUpdate(
const bool /*bIsEnabled*/)
{
const bool bDisabled(SfxItemState::DISABLED == eState);
+ const bool bSetOrDefault = eState >= SfxItemState::DEFAULT;
switch(nSID)
{
case SID_ATTR_LINE_DASH:
+ {
+ const XLineDashItem* pItem = dynamic_cast<const XLineDashItem*>(pState);
+ updateLineDash(bDisabled, bSetOrDefault, pItem);
+ }
+ break;
case SID_ATTR_LINE_STYLE:
{
- if(bDisabled)
- {
- mpFTStyle->Disable();
- mpLBStyle->Disable();
- }
- else
- {
- mpFTStyle->Enable();
- mpLBStyle->Enable();
- }
-
- if(eState >= SfxItemState::DEFAULT)
- {
- if(nSID == SID_ATTR_LINE_STYLE)
- {
- const XLineStyleItem* pItem = dynamic_cast< const XLineStyleItem* >(pState);
-
- if(pItem)
- {
- mpStyleItem.reset(pState ? static_cast<XLineStyleItem*>(pItem->Clone()) : 0);
- }
- }
- else // if(nSID == SID_ATTR_LINE_DASH)
- {
- const XLineDashItem* pItem = dynamic_cast< const XLineDashItem* >(pState);
-
- if(pItem)
- {
- mpDashItem.reset(pState ? static_cast<XLineDashItem*>(pItem->Clone()) : 0);
- }
- }
- }
- else
- {
- if(nSID == SID_ATTR_LINE_STYLE)
- {
- mpStyleItem.reset(0);
- }
- else
- {
- mpDashItem.reset(0);
- }
- }
-
- SelectLineStyle();
- break;
+ const XLineStyleItem* pItem = dynamic_cast<const XLineStyleItem*>(pState);
+ updateLineStyle(bDisabled, bSetOrDefault, pItem);
}
+ break;
case SID_ATTR_LINE_TRANSPARENCE:
{
- if(bDisabled)
- {
- mpFTTransparency->Disable();
- mpMFTransparent->Disable();
- }
- else
- {
- mpFTTransparency->Enable();
- mpMFTransparent->Enable();
- }
-
- if(eState >= SfxItemState::DEFAULT)
- {
- const XLineTransparenceItem* pItem = dynamic_cast< const XLineTransparenceItem* >(pState);
-
- if(pItem)
- {
- mnTrans = pItem->GetValue();
- mpMFTransparent->SetValue(mnTrans);
- break;
- }
- }
-
- mpMFTransparent->SetValue(0);//add
- mpMFTransparent->SetText(OUString());
+ const XLineTransparenceItem* pItem = dynamic_cast<const XLineTransparenceItem*>(pState);
+ updateLineTransparence(bDisabled, bSetOrDefault, pItem);
break;
}
case SID_ATTR_LINE_WIDTH:
{
- if(bDisabled)
- {
- mpTBWidth->Disable();
- mpFTWidth->Disable();
- }
- else
- {
- mpTBWidth->Enable();
- mpFTWidth->Enable();
- }
-
- if(eState >= SfxItemState::DEFAULT)
- {
- const XLineWidthItem* pItem = dynamic_cast< const XLineWidthItem* >(pState);
-
- if(pItem)
- {
- mnWidthCoreValue = pItem->GetValue();
- mbWidthValuable = true;
- SetWidthIcon();
- break;
- }
- }
-
- mbWidthValuable = false;
- SetWidthIcon();
+ const XLineWidthItem* pItem = dynamic_cast<const XLineWidthItem*>(pState);
+ updateLineWidth(bDisabled, bSetOrDefault, pItem);
break;
}
case SID_ATTR_LINE_START:
{
- if(bDisabled)
- {
- mpFTArrow->Disable();
- mpLBStart->Disable();
- }
- else
- {
- mpFTArrow->Enable();
- mpLBStart->Enable();
- }
-
- if(eState >= SfxItemState::DEFAULT)
- {
- const XLineStartItem* pItem = dynamic_cast< const XLineStartItem* >(pState);
-
- if(pItem)
- {
- mpStartItem.reset(static_cast<XLineStartItem*>(pItem->Clone()));
- SelectEndStyle(true);
- break;
- }
- }
-
- mpStartItem.reset(0);
- SelectEndStyle(true);
+ const XLineStartItem* pItem = dynamic_cast<const XLineStartItem*>(pState);
+ updateLineStart(bDisabled, bSetOrDefault, pItem);
break;
}
case SID_ATTR_LINE_END:
{
- if(bDisabled)
- {
- mpFTArrow->Disable();
- mpLBEnd->Disable();
- }
- else
- {
- mpFTArrow->Enable();
- mpLBEnd->Enable();
- }
-
- if(eState >= SfxItemState::DEFAULT)
- {
- const XLineEndItem* pItem = dynamic_cast< const XLineEndItem* >(pState);
-
- if(pItem)
- {
- mpEndItem.reset(static_cast<XLineEndItem*>(pItem->Clone()));
- SelectEndStyle(false);
- break;
- }
- }
-
- mpEndItem.reset(0);
- SelectEndStyle(false);
+ const XLineEndItem* pItem = dynamic_cast<const XLineEndItem*>(pState);
+ updateLineEnd(bDisabled, bSetOrDefault, pItem);
break;
}
case SID_LINEEND_LIST:
@@ -498,482 +179,57 @@ void LinePropertyPanel::NotifyItemUpdate(
}
case SID_ATTR_LINE_JOINT:
{
- if(bDisabled)
- {
- mpLBEdgeStyle->Disable();
- mpFTEdgeStyle->Disable();
- }
- else
- {
- mpLBEdgeStyle->Enable();
- mpFTEdgeStyle->Enable();
- }
-
- if(eState >= SfxItemState::DEFAULT)
- {
- const XLineJointItem* pItem = dynamic_cast< const XLineJointItem* >(pState);
-
- if(pItem)
- {
- sal_Int32 nEntryPos(0);
-
- switch(pItem->GetValue())
- {
- case drawing::LineJoint_MIDDLE:
- case drawing::LineJoint_ROUND:
- {
- nEntryPos = 1;
- break;
- }
- case drawing::LineJoint_NONE:
- {
- nEntryPos = 2;
- break;
- }
- case drawing::LineJoint_MITER:
- {
- nEntryPos = 3;
- break;
- }
- case drawing::LineJoint_BEVEL:
- {
- nEntryPos = 4;
- break;
- }
-
- default:
- break;
- }
-
- if(nEntryPos)
- {
- mpLBEdgeStyle->SelectEntryPos(nEntryPos - 1);
- break;
- }
- }
- }
-
- mpLBEdgeStyle->SetNoSelection();
+ const XLineJointItem* pItem = dynamic_cast<const XLineJointItem*>(pState);
+ updateLineJoint(bDisabled, bSetOrDefault, pItem);
break;
}
case SID_ATTR_LINE_CAP:
{
- if(bDisabled)
- {
- mpLBCapStyle->Disable();
- mpFTCapStyle->Disable();
- }
- else
- {
- mpLBCapStyle->Enable();
- mpLBCapStyle->Enable();
- }
-
- if(eState >= SfxItemState::DEFAULT)
- {
- const XLineCapItem* pItem = dynamic_cast< const XLineCapItem* >(pState);
-
- if(pItem)
- {
- sal_Int32 nEntryPos(0);
-
- switch(pItem->GetValue())
- {
- case drawing::LineCap_BUTT:
- {
- nEntryPos = 1;
- break;
- }
- case drawing::LineCap_ROUND:
- {
- nEntryPos = 2;
- break;
- }
- case drawing::LineCap_SQUARE:
- {
- nEntryPos = 3;
- break;
- }
-
- default:
- break;
- }
-
- if(nEntryPos)
- {
- mpLBCapStyle->SelectEntryPos(nEntryPos - 1);
- break;
- }
- }
- }
-
- mpLBCapStyle->SetNoSelection();
+ const XLineCapItem* pItem = dynamic_cast<const XLineCapItem*>(pState);
+ updateLineCap(bDisabled, bSetOrDefault, pItem);
break;
}
}
}
-IMPL_LINK_NOARG(LinePropertyPanel, ChangeLineStyleHdl)
-{
- const sal_Int32 nPos(mpLBStyle->GetSelectEntryPos());
-
- if(LISTBOX_ENTRY_NOTFOUND != nPos && mpLBStyle->IsValueChangedFromSaved())
- {
- if(0 == nPos)
- {
- // drawing::LineStyle_NONE
- const XLineStyleItem aItem(drawing::LineStyle_NONE);
-
- GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_STYLE, SfxCallMode::RECORD, &aItem, 0L);
- }
- else if(1 == nPos)
- {
- // drawing::LineStyle_SOLID
- const XLineStyleItem aItem(drawing::LineStyle_SOLID);
-
- GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_STYLE, SfxCallMode::RECORD, &aItem, 0L);
- }
- else if (mxLineStyleList.is() && mxLineStyleList->Count() > (long)(nPos - 2))
- {
- // drawing::LineStyle_DASH
- const XLineStyleItem aItemA(drawing::LineStyle_DASH);
- const XDashEntry* pDashEntry = mxLineStyleList->GetDash(nPos - 2);
- OSL_ENSURE(pDashEntry, "OOps, got empty XDash from XDashList (!)");
- const XLineDashItem aItemB(
- pDashEntry ? pDashEntry->GetName() : OUString(),
- pDashEntry ? pDashEntry->GetDash() : XDash());
-
- GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_STYLE, SfxCallMode::RECORD, &aItemA, 0L);
- GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_DASH, SfxCallMode::RECORD, &aItemB, 0L);
- }
- }
-
- return 0;
-}
-
-IMPL_LINK_NOARG(LinePropertyPanel, ChangeStartHdl)
+void LinePropertyPanel::setLineStyle(const XLineStyleItem& rItem)
{
- sal_Int32 nPos = mpLBStart->GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND && mpLBStart->IsValueChangedFromSaved() )
- {
- std::unique_ptr<XLineStartItem> pItem;
- if( nPos == 0 )
- pItem.reset(new XLineStartItem());
- else if( mxLineEndList.is() && mxLineEndList->Count() > (long) ( nPos - 1 ) )
- pItem.reset(new XLineStartItem( mpLBStart->GetSelectEntry(),mxLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
- GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINEEND_STYLE, SfxCallMode::RECORD, pItem.get(), 0L);
- }
- return 0;
+ GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_STYLE, SfxCallMode::RECORD, &rItem, 0L);
}
-IMPL_LINK_NOARG(LinePropertyPanel, ChangeEndHdl)
+void LinePropertyPanel::setLineDash(const XLineDashItem& rItem)
{
- sal_Int32 nPos = mpLBEnd->GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND && mpLBEnd->IsValueChangedFromSaved() )
- {
- std::unique_ptr<XLineEndItem> pItem;
- if( nPos == 0 )
- pItem.reset(new XLineEndItem());
- else if( mxLineEndList.is() && mxLineEndList->Count() > (long) ( nPos - 1 ) )
- pItem.reset(new XLineEndItem( mpLBEnd->GetSelectEntry(), mxLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
- GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINEEND_STYLE, SfxCallMode::RECORD, pItem.get(), 0L);
- }
- return 0;
+ GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_DASH, SfxCallMode::RECORD, &rItem, 0L);
}
-IMPL_LINK_NOARG(LinePropertyPanel, ChangeEdgeStyleHdl)
+void LinePropertyPanel::setLineEndStyle(const XLineEndItem* pItem)
{
- const sal_Int32 nPos(mpLBEdgeStyle->GetSelectEntryPos());
-
- if(LISTBOX_ENTRY_NOTFOUND != nPos && mpLBEdgeStyle->IsValueChangedFromSaved())
- {
- std::unique_ptr<XLineJointItem> pItem;
-
- switch(nPos)
- {
- case 0: // rounded
- {
- pItem.reset(new XLineJointItem(drawing::LineJoint_ROUND));
- break;
- }
- case 1: // none
- {
- pItem.reset(new XLineJointItem(drawing::LineJoint_NONE));
- break;
- }
- case 2: // mitered
- {
- pItem.reset(new XLineJointItem(drawing::LineJoint_MITER));
- break;
- }
- case 3: // beveled
- {
- pItem.reset(new XLineJointItem(drawing::LineJoint_BEVEL));
- break;
- }
- }
-
- GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_JOINT, SfxCallMode::RECORD, pItem.get(), 0L);
- }
- return 0;
+ GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINEEND_STYLE, SfxCallMode::RECORD, pItem, 0L);
}
-IMPL_LINK_NOARG(LinePropertyPanel, ChangeCapStyleHdl)
+void LinePropertyPanel::setLineStartStyle(const XLineStartItem* pItem)
{
- const sal_Int32 nPos(mpLBCapStyle->GetSelectEntryPos());
-
- if(LISTBOX_ENTRY_NOTFOUND != nPos && mpLBCapStyle->IsValueChangedFromSaved())
- {
- std::unique_ptr<XLineCapItem> pItem;
-
- switch(nPos)
- {
- case 0: // flat
- {
- pItem.reset(new XLineCapItem(drawing::LineCap_BUTT));
- break;
- }
- case 1: // round
- {
- pItem.reset(new XLineCapItem(drawing::LineCap_ROUND));
- break;
- }
- case 2: // square
- {
- pItem.reset(new XLineCapItem(drawing::LineCap_SQUARE));
- break;
- }
- }
-
- GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_CAP, SfxCallMode::RECORD, pItem.get(), 0L);
- }
- return 0;
+ GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINEEND_STYLE, SfxCallMode::RECORD, pItem, 0L);
}
-IMPL_LINK_TYPED(LinePropertyPanel, ToolboxWidthSelectHdl,ToolBox*, pToolBox, void)
+void LinePropertyPanel::setLineJoint(const XLineJointItem* pItem)
{
- if (pToolBox->GetItemCommand(pToolBox->GetCurItemId()) == UNO_SELECTWIDTH)
- {
- maLineWidthPopup.SetWidthSelect(mnWidthCoreValue, mbWidthValuable, meMapUnit);
- maLineWidthPopup.Show(*pToolBox);
- }
+ GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_JOINT, SfxCallMode::RECORD, pItem, 0L);
}
-IMPL_LINK_NOARG( LinePropertyPanel, ChangeTransparentHdl )
+void LinePropertyPanel::setLineCap(const XLineCapItem* pItem)
{
- sal_uInt16 nVal = (sal_uInt16)mpMFTransparent->GetValue();
- XLineTransparenceItem aItem( nVal );
-
- GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_STYLE, SfxCallMode::RECORD, &aItem, 0L);
- return 0L;
+ GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_CAP, SfxCallMode::RECORD, pItem, 0L);
}
-VclPtr<PopupControl> LinePropertyPanel::CreateLineWidthPopupControl (PopupContainer* pParent)
+void LinePropertyPanel::setLineTransparency(const XLineTransparenceItem& rItem)
{
- return VclPtrInstance<LineWidthControl>(pParent, *this);
+ GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_STYLE, SfxCallMode::RECORD, &rItem, 0L);
}
-void LinePropertyPanel::EndLineWidthPopupMode()
+void LinePropertyPanel::setLineWidth(const XLineWidthItem& rItem)
{
- maLineWidthPopup.Hide();
-}
-
-void LinePropertyPanel::SetWidthIcon(int n)
-{
- const sal_uInt16 nIdWidth = mpTBWidth->GetItemId(UNO_SELECTWIDTH);
- if (n == 0)
- mpTBWidth->SetItemImage( nIdWidth, maIMGNone);
- else
- mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[n-1]);
-}
-
-void LinePropertyPanel::SetWidthIcon()
-{
- if(!mbWidthValuable)
- {
- const sal_uInt16 nIdWidth = mpTBWidth->GetItemId(UNO_SELECTWIDTH);
- mpTBWidth->SetItemImage(nIdWidth, maIMGNone);
- return;
- }
-
- long nVal = LogicToLogic(mnWidthCoreValue * 10,(MapUnit)meMapUnit , MAP_POINT);
- const sal_uInt16 nIdWidth = mpTBWidth->GetItemId(UNO_SELECTWIDTH);
-
- if(nVal <= 6)
- mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[0]);
- else if(nVal > 6 && nVal <= 9)
- mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[1]);
- else if(nVal > 9 && nVal <= 12)
- mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[2]);
- else if(nVal > 12 && nVal <= 19)
- mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[3]);
- else if(nVal > 19 && nVal <= 26)
- mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[4]);
- else if(nVal > 26 && nVal <= 37)
- mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[5]);
- else if(nVal > 37 && nVal <=52)
- mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[6]);
- else if(nVal > 52)
- mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[7]);
-
-}
-
-void LinePropertyPanel::SetWidth(long nWidth)
-{
- mnWidthCoreValue = nWidth;
- mbWidthValuable = true;
-}
-
-void LinePropertyPanel::FillLineEndList()
-{
- SfxObjectShell* pSh = SfxObjectShell::Current();
- if ( pSh && pSh->GetItem( SID_LINEEND_LIST ) )
- {
- mpLBStart->Enable();
- SvxLineEndListItem aItem( *static_cast<const SvxLineEndListItem*>(pSh->GetItem( SID_LINEEND_LIST ) ) );
- mxLineEndList = aItem.GetLineEndList();
-
- if (mxLineEndList.is())
- {
- FillLineEndListBox(*mpLBStart, *mpLBEnd, *mxLineEndList);
- }
-
- mpLBStart->SelectEntryPos(0);
- mpLBEnd->SelectEntryPos(0);
- }
- else
- {
- mpLBStart->Disable();
- mpLBEnd->Disable();
- }
-}
-
-void LinePropertyPanel::FillLineStyleList()
-{
- SfxObjectShell* pSh = SfxObjectShell::Current();
- if ( pSh && pSh->GetItem( SID_DASH_LIST ) )
- {
- mpLBStyle->Enable();
- SvxDashListItem aItem( *static_cast<const SvxDashListItem*>(pSh->GetItem( SID_DASH_LIST ) ) );
- mxLineStyleList = aItem.GetDashList();
-
- if (mxLineStyleList.is())
- {
- FillLineStyleListBox(*mpLBStyle, *mxLineStyleList);
- }
-
- mpLBStyle->SelectEntryPos(0);
- }
- else
- {
- mpLBStyle->Disable();
- }
-}
-
-void LinePropertyPanel::SelectLineStyle()
-{
- if( !mpStyleItem.get() || !mpDashItem.get() )
- {
- mpLBStyle->SetNoSelection();
- mpLBStyle->Disable();
- return;
- }
-
- const drawing::LineStyle eXLS(mpStyleItem ? (drawing::LineStyle)mpStyleItem->GetValue() : drawing::LineStyle_NONE);
- bool bSelected(false);
-
- switch(eXLS)
- {
- case drawing::LineStyle_NONE:
- break;
- case drawing::LineStyle_SOLID:
- mpLBStyle->SelectEntryPos(1);
- bSelected = true;
- break;
- default:
- if(mpDashItem && mxLineStyleList.is())
- {
- const XDash& rDash = mpDashItem->GetDashValue();
- for(sal_Int32 a(0);!bSelected && a < mxLineStyleList->Count(); a++)
- {
- XDashEntry* pEntry = mxLineStyleList->GetDash(a);
- const XDash& rEntry = pEntry->GetDash();
- if(rDash == rEntry)
- {
- mpLBStyle->SelectEntryPos(a + 2);
- bSelected = true;
- }
- }
- }
- break;
- }
-
- if(!bSelected)
- mpLBStyle->SelectEntryPos( 0 );
-}
-
-void LinePropertyPanel::SelectEndStyle(bool bStart)
-{
- bool bSelected(false);
-
- if(bStart)
- {
- if( !mpStartItem.get() )
- {
- mpLBStart->SetNoSelection();
- mpLBStart->Disable();
- return;
- }
-
- if (mpStartItem && mxLineEndList.is())
- {
- const basegfx::B2DPolyPolygon& rItemPolygon = mpStartItem->GetLineStartValue();
- for(sal_Int32 a(0);!bSelected && a < mxLineEndList->Count(); a++)
- {
- XLineEndEntry* pEntry = mxLineEndList->GetLineEnd(a);
- const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
- if(rItemPolygon == rEntryPolygon)
- {
- mpLBStart->SelectEntryPos(a + 1);
- bSelected = true;
- }
- }
- }
-
- if(!bSelected)
- {
- mpLBStart->SelectEntryPos( 0 );
- }
- }
- else
- {
- if( !mpEndItem.get() )
- {
- mpLBEnd->SetNoSelection();
- mpLBEnd->Disable();
- return;
- }
-
- if (mpEndItem && mxLineEndList.is())
- {
- const basegfx::B2DPolyPolygon& rItemPolygon = mpEndItem->GetLineEndValue();
- for(sal_Int32 a(0);!bSelected && a < mxLineEndList->Count(); a++)
- {
- XLineEndEntry* pEntry = mxLineEndList->GetLineEnd(a);
- const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
- if(rItemPolygon == rEntryPolygon)
- {
- mpLBEnd->SelectEntryPos(a + 1);
- bSelected = true;
- }
- }
- }
-
- if(!bSelected)
- {
- mpLBEnd->SelectEntryPos( 0 );
- }
- }
+ GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_WIDTH, SfxCallMode::RECORD, &rItem, 0L);
}
}} // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx
index 6ef96e1..dc05150 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.hxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.hxx
@@ -29,6 +29,7 @@
#include <svx/sidebar/PanelLayout.hxx>
#include <svx/xtable.hxx>
#include "LineWidthPopup.hxx"
+#include "LinePropertyPanelBase.hxx"
class XLineStyleItem;
@@ -56,7 +57,7 @@ namespace sidebar
class PopupContainer;
class LineWidthControl;
-class LinePropertyPanel : public PanelLayout,
+class LinePropertyPanel : public LinePropertyPanelBase,
public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
@@ -68,9 +69,6 @@ public:
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
- virtual void DataChanged(
- const DataChangedEvent& rEvent) SAL_OVERRIDE;
-
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
@@ -79,34 +77,25 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
- void SetWidth(long nWidth);
- void SetWidthIcon(int n);
- void SetWidthIcon();
-
- void EndLineWidthPopupMode();
-
// constructor/destuctor
LinePropertyPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
-private:
- //ui controls
- VclPtr<FixedText> mpFTWidth;
- VclPtr<ToolBox> mpTBWidth;
- VclPtr<FixedText> mpFTStyle;
- VclPtr<ListBox> mpLBStyle;
- VclPtr<FixedText> mpFTTransparency;
- VclPtr<MetricField> mpMFTransparent;
- VclPtr<FixedText> mpFTArrow;
- VclPtr<ListBox> mpLBStart;
- VclPtr<ListBox> mpLBEnd;
- VclPtr<FixedText> mpFTEdgeStyle;
- VclPtr<ListBox> mpLBEdgeStyle;
- VclPtr<FixedText> mpFTCapStyle;
- VclPtr<ListBox> mpLBCapStyle;
+ virtual void setLineWidth(const XLineWidthItem& rItem) SAL_OVERRIDE;
+protected:
+
+ virtual void setLineStyle(const XLineStyleItem& rItem) SAL_OVERRIDE;
+ virtual void setLineDash(const XLineDashItem& rItem) SAL_OVERRIDE;
+ virtual void setLineEndStyle(const XLineEndItem* pItem) SAL_OVERRIDE;
+ virtual void setLineStartStyle(const XLineStartItem* pItem) SAL_OVERRIDE;
+ virtual void setLineTransparency(const XLineTransparenceItem& rItem) SAL_OVERRIDE;
+ virtual void setLineJoint(const XLineJointItem* pItem) SAL_OVERRIDE;
+ virtual void setLineCap(const XLineCapItem* pItem) SAL_OVERRIDE;
+
+private:
//ControllerItem
sfx2::sidebar::ControllerItem maStyleControl;
sfx2::sidebar::ControllerItem maDashControl;
@@ -119,47 +108,10 @@ private:
sfx2::sidebar::ControllerItem maEdgeStyle;
sfx2::sidebar::ControllerItem maCapStyle;
- std::unique_ptr<XLineStyleItem> mpStyleItem;
- std::unique_ptr<XLineDashItem> mpDashItem;
-
- sal_uInt16 mnTrans;
- SfxMapUnit meMapUnit;
- sal_Int32 mnWidthCoreValue;
- XLineEndListRef mxLineEndList;
- XDashListRef mxLineStyleList;
- std::unique_ptr<XLineStartItem> mpStartItem;
- std::unique_ptr<XLineEndItem> mpEndItem;
-
- //popup windows
- LineWidthPopup maLineWidthPopup;
-
- // images from resource
- Image maIMGNone;
-
- // multi-images
- std::unique_ptr<Image[]> mpIMGWidthIcon;
-
css::uno::Reference<css::frame::XFrame> mxFrame;
SfxBindings* mpBindings;
- /// bitfield
- bool mbWidthValuable : 1;
-
void Initialize();
- void FillLineEndList();
- void FillLineStyleList();
- void SelectEndStyle(bool bStart);
- void SelectLineStyle();
-
- DECL_LINK(ChangeLineStyleHdl, void*);
- DECL_LINK_TYPED(ToolboxWidthSelectHdl, ToolBox*, void);
- DECL_LINK(ChangeTransparentHdl , void *);
- DECL_LINK(ChangeStartHdl, void *);
- DECL_LINK(ChangeEndHdl, void *);
- DECL_LINK(ChangeEdgeStyleHdl, void *);
- DECL_LINK(ChangeCapStyleHdl, void *);
-
- VclPtr<PopupControl> CreateLineWidthPopupControl (PopupContainer* pParent);
};
} } // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
new file mode 100644
index 0000000..45d0ebd
--- /dev/null
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -0,0 +1,916 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#include <sfx2/sidebar/ResourceDefinitions.hrc>
+#include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/sidebar/ControlFactory.hxx>
+#include <LinePropertyPanelBase.hxx>
+#include <LinePropertyPanel.hrc>
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+#include <sfx2/objsh.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <svx/xtable.hxx>
+#include <svx/xdash.hxx>
+#include <svx/drawitem.hxx>
+#include <svx/svxitems.hrc>
+#include <svtools/valueset.hxx>
+#include <unotools/pathoptions.hxx>
+#include <unotools/viewoptions.hxx>
+#include <comphelper/processfactory.hxx>
+#include <i18nlangtag/mslangid.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/xlndsit.hxx>
+#include <vcl/svapp.hxx>
+#include <svx/xlnwtit.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/toolbox.hxx>
+#include <svx/xlntrit.hxx>
+#include <svx/xlnstit.hxx>
+#include <svx/xlnedit.hxx>
+#include <svx/xlncapit.hxx>
+#include <svx/xlinjoit.hxx>
+#include "svx/sidebar/PopupContainer.hxx"
+#include "svx/sidebar/PopupControl.hxx"
+#include "LineWidthControl.hxx"
+#include <boost/bind.hpp>
+
+using namespace css;
+using namespace css::uno;
+using sfx2::sidebar::Theme;
+
+const char UNO_SELECTWIDTH[] = ".uno:SelectWidth";
+
+namespace
+{
+
+void FillLineEndListBox(ListBox& rListBoxStart, ListBox& rListBoxEnd, const XLineEndList& rList)
+{
+ const sal_uInt32 nCount(rList.Count());
+ const OUString sNone(SVX_RESSTR(RID_SVXSTR_NONE));
+
+ rListBoxStart.SetUpdateMode(false);
+ rListBoxEnd.SetUpdateMode(false);
+
+ rListBoxStart.Clear();
+ rListBoxEnd.Clear();
+
+ // add 'none' entries
+ rListBoxStart.InsertEntry(sNone);
+ rListBoxEnd.InsertEntry(sNone);
+
+ for(sal_uInt32 i(0); i < nCount; i++)
+ {
+ XLineEndEntry* pEntry = rList.GetLineEnd(i);
+ const Bitmap aBitmap = const_cast< XLineEndList& >(rList).GetUiBitmap(i);
+
+ if(!aBitmap.IsEmpty())
+ {
+ Bitmap aCopyStart(aBitmap);
+ Bitmap aCopyEnd(aBitmap);
+
+ const Size aBmpSize(aCopyStart.GetSizePixel());
+ const Rectangle aCropRectStart(Point(), Size(aBmpSize.Width() / 2, aBmpSize.Height()));
+ const Rectangle aCropRectEnd(Point(aBmpSize.Width() / 2, 0), Size(aBmpSize.Width() / 2, aBmpSize.Height()));
+
+ aCopyStart.Crop(aCropRectStart);
+ rListBoxStart.InsertEntry(
+ pEntry->GetName(),
+ Image(aCopyStart));
+
+ aCopyEnd.Crop(aCropRectEnd);
+ rListBoxEnd.InsertEntry(
+ pEntry->GetName(),
+ Image(aCopyEnd));
+ }
+ else
+ {
+ rListBoxStart.InsertEntry(pEntry->GetName());
+ rListBoxEnd.InsertEntry(pEntry->GetName());
+ }
+ }
+
+ rListBoxStart.SetUpdateMode(true);
+ rListBoxEnd.SetUpdateMode(true);
+}
+
+void FillLineStyleListBox(ListBox& rListBox, const XDashList& rList)
+{
+ const sal_uInt32 nCount(rList.Count());
+ rListBox.SetUpdateMode(false);
+
+ rListBox.Clear();
+
+ // entry for 'none'
+ rListBox.InsertEntry(rList.GetStringForUiNoLine());
+
+ // entry for solid line
+ rListBox.InsertEntry(rList.GetStringForUiSolidLine(),
+ Image( rList.GetBitmapForUISolidLine()));
+
+ for(sal_uInt32 i(0); i < nCount; i++)
+ {
+ XDashEntry* pEntry = rList.GetDash(i);
+ const Bitmap aBitmap = const_cast< XDashList& >(rList).GetUiBitmap(i);
+
+ if(!aBitmap.IsEmpty())
+ {
+ rListBox.InsertEntry(pEntry->GetName(), Image(aBitmap));
+ }
+ else
+ {
+ rListBox.InsertEntry(pEntry->GetName());
+ }
+ }
+
+ rListBox.SetUpdateMode(true);
+}
+
+} // end of anonymous namespace
+
+namespace svx { namespace sidebar {
+
+LinePropertyPanelBase::LinePropertyPanelBase(
+ vcl::Window* pParent,
+ const uno::Reference<frame::XFrame>& rxFrame)
+: PanelLayout(pParent, "LinePropertyPanelBase", "svx/ui/sidebarline.ui", rxFrame),
+ mpStyleItem(),
+ mpDashItem(),
+ mnTrans(0),
+ meMapUnit(SFX_MAPUNIT_MM),
+ mnWidthCoreValue(0),
+ mpStartItem(),
+ mpEndItem(),
+ maLineWidthPopup(this, ::boost::bind(&LinePropertyPanelBase::CreateLineWidthPopupControl, this, _1)),
+ maIMGNone(SVX_RES(IMG_NONE_ICON)),
+ mpIMGWidthIcon(),
+ mxFrame(rxFrame),
+ mbWidthValuable(true)
+{
+ get(mpFTWidth, "widthlabel");
+ get(mpTBWidth, "width");
+ get(mpFTStyle, "stylelabel");
+ get(mpLBStyle, "linestyle");
+ get(mpFTTransparency, "translabel");
+ get(mpMFTransparent, "linetransparency");
+ get(mpFTArrow, "arrowlabel");
+ get(mpLBStart, "beginarrowstyle");
+ get(mpLBEnd, "endarrowstyle");
+ get(mpFTEdgeStyle, "cornerlabel");
+ get(mpLBEdgeStyle, "edgestyle");
+ get(mpFTCapStyle, "caplabel");
+ get(mpLBCapStyle, "linecapstyle");
+
+ Initialize();
+}
+
+LinePropertyPanelBase::~LinePropertyPanelBase()
+{
+ disposeOnce();
+}
+
+void LinePropertyPanelBase::dispose()
+{
+ mpFTWidth.clear();
+ mpTBWidth.clear();
+ mpFTStyle.clear();
+ mpLBStyle.clear();
+ mpFTTransparency.clear();
+ mpMFTransparent.clear();
+ mpFTArrow.clear();
+ mpLBStart.clear();
+ mpLBEnd.clear();
+ mpFTEdgeStyle.clear();
+ mpLBEdgeStyle.clear();
+ mpFTCapStyle.clear();
+ mpLBCapStyle.clear();
+
+ PanelLayout::dispose();
+}
+
+void LinePropertyPanelBase::Initialize()
+{
+ mpIMGWidthIcon.reset(new Image[8]);
+ mpIMGWidthIcon[0] = Image(SVX_RES(IMG_WIDTH1_ICON));
+ mpIMGWidthIcon[1] = Image(SVX_RES(IMG_WIDTH2_ICON));
+ mpIMGWidthIcon[2] = Image(SVX_RES(IMG_WIDTH3_ICON));
+ mpIMGWidthIcon[3] = Image(SVX_RES(IMG_WIDTH4_ICON));
+ mpIMGWidthIcon[4] = Image(SVX_RES(IMG_WIDTH5_ICON));
+ mpIMGWidthIcon[5] = Image(SVX_RES(IMG_WIDTH6_ICON));
+ mpIMGWidthIcon[6] = Image(SVX_RES(IMG_WIDTH7_ICON));
+ mpIMGWidthIcon[7] = Image(SVX_RES(IMG_WIDTH8_ICON));
+
+ // meMapUnit = maWidthControl.GetCoreMetric();
+
+ FillLineStyleList();
+ SelectLineStyle();
+ Link<> aLink = LINK( this, LinePropertyPanelBase, ChangeLineStyleHdl );
+ mpLBStyle->SetSelectHdl( aLink );
+ mpLBStyle->SetAccessibleName(OUString( "Style"));
+ mpLBStyle->AdaptDropDownLineCountToMaximum();
+
+ const sal_uInt16 nIdWidth = mpTBWidth->GetItemId(UNO_SELECTWIDTH);
+ mpTBWidth->SetItemImage(nIdWidth, mpIMGWidthIcon[0]);
+ mpTBWidth->SetItemBits( nIdWidth, mpTBWidth->GetItemBits( nIdWidth ) | ToolBoxItemBits::DROPDOWNONLY );
+ Link<ToolBox *, void> aLink2 = LINK(this, LinePropertyPanelBase, ToolboxWidthSelectHdl);
+ mpTBWidth->SetDropdownClickHdl ( aLink2 );
+ mpTBWidth->SetSelectHdl ( aLink2 );
+
+ FillLineEndList();
+ SelectEndStyle(true);
+ SelectEndStyle(false);
+ aLink = LINK( this, LinePropertyPanelBase, ChangeStartHdl );
+ mpLBStart->SetSelectHdl( aLink );
+ mpLBStart->SetAccessibleName(OUString("Beginning Style")); //wj acc
+ mpLBStart->AdaptDropDownLineCountToMaximum();
+ aLink = LINK( this, LinePropertyPanelBase, ChangeEndHdl );
+ mpLBEnd->SetSelectHdl( aLink );
+ mpLBEnd->SetAccessibleName(OUString("Ending Style")); //wj acc
+ mpLBEnd->AdaptDropDownLineCountToMaximum();
+
+ aLink = LINK(this, LinePropertyPanelBase, ChangeTransparentHdl);
+ mpMFTransparent->SetModifyHdl(aLink);
+ mpMFTransparent->SetAccessibleName(OUString("Transparency")); //wj acc
+
+ mpTBWidth->SetAccessibleRelationLabeledBy(mpFTWidth);
+ mpLBStyle->SetAccessibleRelationLabeledBy(mpFTStyle);
+ mpMFTransparent->SetAccessibleRelationLabeledBy(mpFTTransparency);
+ mpLBStart->SetAccessibleRelationLabeledBy(mpFTArrow);
+ mpLBEnd->SetAccessibleRelationLabeledBy(mpLBEnd);
+
+ aLink = LINK( this, LinePropertyPanelBase, ChangeEdgeStyleHdl );
+ mpLBEdgeStyle->SetSelectHdl( aLink );
+ mpLBEdgeStyle->SetAccessibleName(OUString("Corner Style"));
+
+ aLink = LINK( this, LinePropertyPanelBase, ChangeCapStyleHdl );
+ mpLBCapStyle->SetSelectHdl( aLink );
+ mpLBCapStyle->SetAccessibleName(OUString("Cap Style"));
+}
+
+void LinePropertyPanelBase::DataChanged(const DataChangedEvent& /*rEvent*/)
+{
+}
+
+void LinePropertyPanelBase::updateLineStyle(bool bDisabled, bool bSetOrDefault, const XLineStyleItem* pItem)
+{
+ if(bDisabled)
+ {
+ mpFTStyle->Disable();
+ mpLBStyle->Disable();
+ }
+ else
+ {
+ mpFTStyle->Enable();
+ mpLBStyle->Enable();
+ }
+
+ if(bSetOrDefault)
+ {
+ if(pItem)
+ {
+ mpStyleItem.reset(static_cast<XLineStyleItem*>(pItem->Clone()));
+ }
+ }
+ else
+ {
+ mpStyleItem.reset(0);
+ }
+
+ SelectLineStyle();
+}
+
+void LinePropertyPanelBase::updateLineDash(bool bDisabled, bool bSetOrDefault, const XLineDashItem* pItem)
+{
+ if(bDisabled)
+ {
+ mpFTStyle->Disable();
+ mpLBStyle->Disable();
+ }
+ else
+ {
+ mpFTStyle->Enable();
+ mpLBStyle->Enable();
+ }
+
+ if(bSetOrDefault)
+ {
+ if(pItem)
+ {
+ mpDashItem.reset(static_cast<XLineDashItem*>(pItem->Clone()));
+ }
+ }
+ else
+ {
+ mpDashItem.reset();
+ }
+
+ SelectLineStyle();
+}
+
+void LinePropertyPanelBase::updateLineTransparence(bool bDisabled, bool bSetOrDefault,
+ const XLineTransparenceItem* pItem)
+{
+ if(bDisabled)
+ {
+ mpFTTransparency->Disable();
+ mpMFTransparent->Disable();
+ }
+ else
+ {
+ mpFTTransparency->Enable();
+ mpMFTransparent->Enable();
+ }
+
+ if(bSetOrDefault)
+ {
+ if(pItem)
+ {
+ mnTrans = pItem->GetValue();
+ mpMFTransparent->SetValue(mnTrans);
+ return;
+ }
+ }
+
+ mpMFTransparent->SetValue(0);//add
+ mpMFTransparent->SetText(OUString());
+}
+
+void LinePropertyPanelBase::updateLineWidth(bool bDisabled, bool bSetOrDefault,
+ const XLineWidthItem* pItem)
+{
+ if(bDisabled)
+ {
+ mpTBWidth->Disable();
+ mpFTWidth->Disable();
+ }
+ else
+ {
+ mpTBWidth->Enable();
+ mpFTWidth->Enable();
+ }
+
+ if(bSetOrDefault)
+ {
+ if(pItem)
+ {
+ mnWidthCoreValue = pItem->GetValue();
+ mbWidthValuable = true;
+ SetWidthIcon();
+ return;
+ }
+ }
+
+ mbWidthValuable = false;
+ SetWidthIcon();
+}
+
+void LinePropertyPanelBase::updateLineStart(bool bDisabled, bool bSetOrDefault,
+ const XLineStartItem* pItem)
+{
+ if(bDisabled)
+ {
+ mpFTArrow->Disable();
+ mpLBStart->Disable();
+ }
+ else
+ {
+ mpFTArrow->Enable();
+ mpLBStart->Enable();
+ }
+
+ if(bSetOrDefault)
+ {
+ if(pItem)
+ {
+ mpStartItem.reset(static_cast<XLineStartItem*>(pItem->Clone()));
+ SelectEndStyle(true);
+ return;
+ }
+ }
+
+ mpStartItem.reset(0);
+ SelectEndStyle(true);
+}
+
+void LinePropertyPanelBase::updateLineEnd(bool bDisabled, bool bSetOrDefault,
+ const XLineEndItem* pItem)
+{
+ if(bDisabled)
+ {
+ mpFTArrow->Disable();
+ mpLBEnd->Disable();
+ }
+ else
+ {
+ mpFTArrow->Enable();
+ mpLBEnd->Enable();
+ }
+
+ if(bSetOrDefault)
+ {
+ if(pItem)
+ {
+ mpEndItem.reset(static_cast<XLineEndItem*>(pItem->Clone()));
+ SelectEndStyle(false);
+ return;
+ }
+ }
+
+ mpEndItem.reset(0);
+ SelectEndStyle(false);
+}
+
+void LinePropertyPanelBase::updateLineJoint(bool bDisabled, bool bSetOrDefault,
+ const XLineJointItem* pItem)
+{
+ if(bDisabled)
+ {
+ mpLBEdgeStyle->Disable();
+ mpFTEdgeStyle->Disable();
+ }
+ else
+ {
+ mpLBEdgeStyle->Enable();
+ mpFTEdgeStyle->Enable();
+ }
+
+ if(bSetOrDefault)
+ {
+ if(pItem)
+ {
+ sal_Int32 nEntryPos(0);
+
+ switch(pItem->GetValue())
+ {
+ case drawing::LineJoint_MIDDLE:
+ case drawing::LineJoint_ROUND:
+ {
+ nEntryPos = 1;
+ break;
+ }
+ case drawing::LineJoint_NONE:
+ {
+ nEntryPos = 2;
+ break;
+ }
+ case drawing::LineJoint_MITER:
+ {
+ nEntryPos = 3;
+ break;
+ }
+ case drawing::LineJoint_BEVEL:
+ {
+ nEntryPos = 4;
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ if(nEntryPos)
+ {
+ mpLBEdgeStyle->SelectEntryPos(nEntryPos - 1);
+ return;
+ }
+ }
+ }
+
+ mpLBEdgeStyle->SetNoSelection();
+}
+
+void LinePropertyPanelBase::updateLineCap(bool bDisabled, bool bSetOrDefault,
+ const XLineCapItem* pItem)
+{
+ if(bDisabled)
+ {
+ mpLBCapStyle->Disable();
+ mpFTCapStyle->Disable();
+ }
+ else
+ {
+ mpLBCapStyle->Enable();
+ mpLBCapStyle->Enable();
+ }
+
+ if(bSetOrDefault)
+ {
+ if(pItem)
+ {
+ sal_Int32 nEntryPos(0);
+
+ switch(pItem->GetValue())
+ {
+ case drawing::LineCap_BUTT:
+ {
+ nEntryPos = 1;
+ break;
+ }
+ case drawing::LineCap_ROUND:
+ {
+ nEntryPos = 2;
+ break;
+ }
+ case drawing::LineCap_SQUARE:
+ {
+ nEntryPos = 3;
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ if(nEntryPos)
+ {
+ mpLBCapStyle->SelectEntryPos(nEntryPos - 1);
+ return;
+ }
+ }
+ }
+
+ mpLBCapStyle->SetNoSelection();
+}
+
+IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeLineStyleHdl)
+{
+ const sal_Int32 nPos(mpLBStyle->GetSelectEntryPos());
+
+ if(LISTBOX_ENTRY_NOTFOUND != nPos && mpLBStyle->IsValueChangedFromSaved())
+ {
+ if(0 == nPos)
+ {
+ // drawing::LineStyle_NONE
+ const XLineStyleItem aItem(drawing::LineStyle_NONE);
+
+ setLineStyle(aItem);
+ }
+ else if(1 == nPos)
+ {
+ // drawing::LineStyle_SOLID
+ const XLineStyleItem aItem(drawing::LineStyle_SOLID);
+
+ setLineStyle(aItem);
+ }
+ else if (mxLineStyleList.is() && mxLineStyleList->Count() > (long)(nPos - 2))
+ {
+ // drawing::LineStyle_DASH
+ const XLineStyleItem aItemA(drawing::LineStyle_DASH);
+ const XDashEntry* pDashEntry = mxLineStyleList->GetDash(nPos - 2);
+ OSL_ENSURE(pDashEntry, "OOps, got empty XDash from XDashList (!)");
+ const XLineDashItem aItemB(
+ pDashEntry ? pDashEntry->GetName() : OUString(),
+ pDashEntry ? pDashEntry->GetDash() : XDash());
+
+ setLineStyle(aItemA);
+ setLineDash(aItemB);
+ }
+ }
+
+ return 0;
+}
+
+IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeStartHdl)
+{
+ sal_Int32 nPos = mpLBStart->GetSelectEntryPos();
+ if( nPos != LISTBOX_ENTRY_NOTFOUND && mpLBStart->IsValueChangedFromSaved() )
+ {
+ std::unique_ptr<XLineStartItem> pItem;
+ if( nPos == 0 )
+ pItem.reset(new XLineStartItem());
+ else if( mxLineEndList.is() && mxLineEndList->Count() > (long) ( nPos - 1 ) )
+ pItem.reset(new XLineStartItem( mpLBStart->GetSelectEntry(),mxLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
+ setLineStartStyle(pItem.get());
+ }
+ return 0;
+}
+
+IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeEndHdl)
+{
+ sal_Int32 nPos = mpLBEnd->GetSelectEntryPos();
+ if( nPos != LISTBOX_ENTRY_NOTFOUND && mpLBEnd->IsValueChangedFromSaved() )
+ {
+ std::unique_ptr<XLineEndItem> pItem;
+ if( nPos == 0 )
+ pItem.reset(new XLineEndItem());
+ else if( mxLineEndList.is() && mxLineEndList->Count() > (long) ( nPos - 1 ) )
+ pItem.reset(new XLineEndItem( mpLBEnd->GetSelectEntry(), mxLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
+ setLineEndStyle(pItem.get());
+ }
+ return 0;
+}
+
+IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeEdgeStyleHdl)
+{
+ const sal_Int32 nPos(mpLBEdgeStyle->GetSelectEntryPos());
+
+ if(LISTBOX_ENTRY_NOTFOUND != nPos && mpLBEdgeStyle->IsValueChangedFromSaved())
+ {
+ std::unique_ptr<XLineJointItem> pItem;
+
+ switch(nPos)
+ {
+ case 0: // rounded
+ {
+ pItem.reset(new XLineJointItem(drawing::LineJoint_ROUND));
+ break;
+ }
+ case 1: // none
+ {
+ pItem.reset(new XLineJointItem(drawing::LineJoint_NONE));
+ break;
+ }
+ case 2: // mitered
+ {
+ pItem.reset(new XLineJointItem(drawing::LineJoint_MITER));
+ break;
+ }
+ case 3: // beveled
+ {
+ pItem.reset(new XLineJointItem(drawing::LineJoint_BEVEL));
+ break;
+ }
+ }
+
+ setLineJoint(pItem.get());
+ }
+ return 0;
+}
+
+IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeCapStyleHdl)
+{
+ const sal_Int32 nPos(mpLBCapStyle->GetSelectEntryPos());
+
+ if(LISTBOX_ENTRY_NOTFOUND != nPos && mpLBCapStyle->IsValueChangedFromSaved())
+ {
+ std::unique_ptr<XLineCapItem> pItem;
+
+ switch(nPos)
+ {
+ case 0: // flat
+ {
+ pItem.reset(new XLineCapItem(drawing::LineCap_BUTT));
+ break;
+ }
+ case 1: // round
+ {
+ pItem.reset(new XLineCapItem(drawing::LineCap_ROUND));
+ break;
+ }
+ case 2: // square
+ {
+ pItem.reset(new XLineCapItem(drawing::LineCap_SQUARE));
+ break;
+ }
+ }
+
+ setLineCap(pItem.get());
+ }
+ return 0;
+}
+
+IMPL_LINK_TYPED(LinePropertyPanelBase, ToolboxWidthSelectHdl,ToolBox*, pToolBox, void)
+{
+ if (pToolBox->GetItemCommand(pToolBox->GetCurItemId()) == UNO_SELECTWIDTH)
+ {
+ maLineWidthPopup.SetWidthSelect(mnWidthCoreValue, mbWidthValuable, meMapUnit);
+ maLineWidthPopup.Show(*pToolBox);
+ }
+}
+
+IMPL_LINK_NOARG( LinePropertyPanelBase, ChangeTransparentHdl )
+{
+ sal_uInt16 nVal = (sal_uInt16)mpMFTransparent->GetValue();
+ XLineTransparenceItem aItem( nVal );
+
+ setLineTransparency(aItem);
+ return 0L;
+}
+
+VclPtr<PopupControl> LinePropertyPanelBase::CreateLineWidthPopupControl (PopupContainer* pParent)
+{
+ return VclPtrInstance<LineWidthControl>(pParent, *this);
+}
+
+void LinePropertyPanelBase::EndLineWidthPopupMode()
+{
+ maLineWidthPopup.Hide();
+}
+
+void LinePropertyPanelBase::SetWidthIcon(int n)
+{
+ const sal_uInt16 nIdWidth = mpTBWidth->GetItemId(UNO_SELECTWIDTH);
+ if (n == 0)
+ mpTBWidth->SetItemImage( nIdWidth, maIMGNone);
+ else
+ mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[n-1]);
+}
+
+void LinePropertyPanelBase::SetWidthIcon()
+{
+ if(!mbWidthValuable)
+ {
+ const sal_uInt16 nIdWidth = mpTBWidth->GetItemId(UNO_SELECTWIDTH);
+ mpTBWidth->SetItemImage(nIdWidth, maIMGNone);
+ return;
+ }
+
+ long nVal = LogicToLogic(mnWidthCoreValue * 10,(MapUnit)meMapUnit , MAP_POINT);
+ const sal_uInt16 nIdWidth = mpTBWidth->GetItemId(UNO_SELECTWIDTH);
+
+ if(nVal <= 6)
+ mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[0]);
+ else if(nVal > 6 && nVal <= 9)
+ mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[1]);
+ else if(nVal > 9 && nVal <= 12)
+ mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[2]);
+ else if(nVal > 12 && nVal <= 19)
+ mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[3]);
+ else if(nVal > 19 && nVal <= 26)
+ mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[4]);
+ else if(nVal > 26 && nVal <= 37)
+ mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[5]);
+ else if(nVal > 37 && nVal <=52)
+ mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[6]);
+ else if(nVal > 52)
+ mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[7]);
+
+}
+
+void LinePropertyPanelBase::SetWidth(long nWidth)
+{
+ mnWidthCoreValue = nWidth;
+ mbWidthValuable = true;
+}
+
+void LinePropertyPanelBase::FillLineEndList()
+{
+ SfxObjectShell* pSh = SfxObjectShell::Current();
+ if ( pSh && pSh->GetItem( SID_LINEEND_LIST ) )
+ {
+ mpLBStart->Enable();
+ SvxLineEndListItem aItem( *static_cast<const SvxLineEndListItem*>(pSh->GetItem( SID_LINEEND_LIST ) ) );
+ mxLineEndList = aItem.GetLineEndList();
+
+ if (mxLineEndList.is())
+ {
+ FillLineEndListBox(*mpLBStart, *mpLBEnd, *mxLineEndList);
+ }
+
+ mpLBStart->SelectEntryPos(0);
+ mpLBEnd->SelectEntryPos(0);
+ }
+ else
+ {
+ mpLBStart->Disable();
+ mpLBEnd->Disable();
+ }
+}
+
+void LinePropertyPanelBase::FillLineStyleList()
+{
+ SfxObjectShell* pSh = SfxObjectShell::Current();
+ if ( pSh && pSh->GetItem( SID_DASH_LIST ) )
+ {
+ mpLBStyle->Enable();
+ SvxDashListItem aItem( *static_cast<const SvxDashListItem*>(pSh->GetItem( SID_DASH_LIST ) ) );
+ mxLineStyleList = aItem.GetDashList();
+
+ if (mxLineStyleList.is())
+ {
+ FillLineStyleListBox(*mpLBStyle, *mxLineStyleList);
+ }
+
+ mpLBStyle->SelectEntryPos(0);
+ }
+ else
+ {
+ mpLBStyle->Disable();
+ }
+}
+
+void LinePropertyPanelBase::SelectLineStyle()
+{
+ if( !mpStyleItem.get() || !mpDashItem.get() )
+ {
+ mpLBStyle->SetNoSelection();
+ mpLBStyle->Disable();
+ return;
+ }
+
+ const drawing::LineStyle eXLS(mpStyleItem ? (drawing::LineStyle)mpStyleItem->GetValue() : drawing::LineStyle_NONE);
+ bool bSelected(false);
+
+ switch(eXLS)
+ {
+ case drawing::LineStyle_NONE:
+ break;
+ case drawing::LineStyle_SOLID:
+ mpLBStyle->SelectEntryPos(1);
+ bSelected = true;
+ break;
+ default:
+ if(mpDashItem && mxLineStyleList.is())
+ {
+ const XDash& rDash = mpDashItem->GetDashValue();
+ for(sal_Int32 a(0);!bSelected && a < mxLineStyleList->Count(); a++)
+ {
+ XDashEntry* pEntry = mxLineStyleList->GetDash(a);
+ const XDash& rEntry = pEntry->GetDash();
+ if(rDash == rEntry)
+ {
+ mpLBStyle->SelectEntryPos(a + 2);
+ bSelected = true;
+ }
+ }
+ }
+ break;
+ }
+
+ if(!bSelected)
+ mpLBStyle->SelectEntryPos( 0 );
+}
+
+void LinePropertyPanelBase::SelectEndStyle(bool bStart)
+{
+ bool bSelected(false);
+
+ if(bStart)
+ {
+ if( !mpStartItem.get() )
+ {
+ mpLBStart->SetNoSelection();
+ mpLBStart->Disable();
+ return;
+ }
+
+ if (mpStartItem && mxLineEndList.is())
+ {
+ const basegfx::B2DPolyPolygon& rItemPolygon = mpStartItem->GetLineStartValue();
+ for(sal_Int32 a(0);!bSelected && a < mxLineEndList->Count(); a++)
+ {
+ XLineEndEntry* pEntry = mxLineEndList->GetLineEnd(a);
+ const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
+ if(rItemPolygon == rEntryPolygon)
+ {
+ mpLBStart->SelectEntryPos(a + 1);
+ bSelected = true;
+ }
+ }
+ }
+
+ if(!bSelected)
+ {
+ mpLBStart->SelectEntryPos( 0 );
+ }
+ }
+ else
+ {
+ if( !mpEndItem.get() )
+ {
+ mpLBEnd->SetNoSelection();
+ mpLBEnd->Disable();
+ return;
+ }
+
+ if (mpEndItem && mxLineEndList.is())
+ {
+ const basegfx::B2DPolyPolygon& rItemPolygon = mpEndItem->GetLineEndValue();
+ for(sal_Int32 a(0);!bSelected && a < mxLineEndList->Count(); a++)
+ {
+ XLineEndEntry* pEntry = mxLineEndList->GetLineEnd(a);
+ const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
+ if(rItemPolygon == rEntryPolygon)
+ {
+ mpLBEnd->SelectEntryPos(a + 1);
+ bSelected = true;
+ }
+ }
+ }
+
+ if(!bSelected)
+ {
+ mpLBEnd->SelectEntryPos( 0 );
+ }
+ }
+}
+
+}} // end of namespace svx::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.hxx b/svx/source/sidebar/line/LinePropertyPanelBase.hxx
new file mode 100644
index 0000000..656496c
--- /dev/null
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.hxx
@@ -0,0 +1,168 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
+#define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
+
+#include <svx/xdash.hxx>
+#include <vcl/ctrl.hxx>
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <memory>
+#include <svx/sidebar/PanelLayout.hxx>
+#include <svx/xtable.hxx>
+#include "LineWidthPopup.hxx"
+
+
+class XLineStyleItem;
+class XLineDashItem;
+class XLineStartItem;
+class XLineWidthItem;
+class XLineEndItem;
+class XLineEndList;
+class XLineJointItem;
+class XLineCapItem;
+class XLineTransparenceItem;
+class XDashList;
+class ListBox;
+class ToolBox;
+class FloatingWindow;
+
+namespace
+{
+
+#define SIDEBAR_LINE_WIDTH_GLOBAL_VALUE "PopupPanel_LineWidth"
+
+} //end of anonymous namespace
+
+namespace svx
+{
+namespace sidebar
+{
+
+class PopupContainer;
+class LineWidthControl;
+
+class LinePropertyPanelBase : public PanelLayout
+{
+public:
+ virtual ~LinePropertyPanelBase();
+ virtual void dispose() SAL_OVERRIDE;
+
+ virtual void DataChanged(
+ const DataChangedEvent& rEvent) SAL_OVERRIDE;
+
+ void SetWidth(long nWidth);
+ void SetWidthIcon(int n);
+ void SetWidthIcon();
+
+ void EndLineWidthPopupMode();
+
+ // constructor/destuctor
+ LinePropertyPanelBase(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
+ virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
+
+protected:
+
+ virtual void setLineStyle(const XLineStyleItem& rItem) = 0;
+ virtual void setLineDash(const XLineDashItem& rItem) = 0;
+ virtual void setLineEndStyle(const XLineEndItem* pItem) = 0;
+ virtual void setLineStartStyle(const XLineStartItem* pItem) = 0;
+ virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0;
+ virtual void setLineJoint(const XLineJointItem* pItem) = 0;
+ virtual void setLineCap(const XLineCapItem* pItem) = 0;
+
+
+ void updateLineStyle(bool bDisabled, bool bSetOrDefault, const XLineStyleItem* pItem);
+ void updateLineDash(bool bDisabled, bool bSetOrDefault, const XLineDashItem* pItem);
+ void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const XLineTransparenceItem* pItem);
+ void updateLineWidth(bool bDisabled, bool bSetOrDefault, const XLineWidthItem* pItem);
+ void updateLineStart(bool bDisabled, bool bSetOrDefault, const XLineStartItem* pItem);
+ void updateLineEnd(bool bDisabled, bool bSetOrDefault, const XLineEndItem* pItem);
+ void updateLineJoint(bool bDisabled, bool bSetOrDefault, const XLineJointItem* pItem);
+ void updateLineCap(bool bDisabled, bool bSetOrDefault, const XLineCapItem* pItem);
+
+ void FillLineEndList();
+ void FillLineStyleList();
+ void SelectEndStyle(bool bStart);
+ void SelectLineStyle();
+
+private:
+ //ui controls
+ VclPtr<FixedText> mpFTWidth;
+ VclPtr<ToolBox> mpTBWidth;
+ VclPtr<FixedText> mpFTStyle;
+ VclPtr<ListBox> mpLBStyle;
+ VclPtr<FixedText> mpFTTransparency;
+ VclPtr<MetricField> mpMFTransparent;
+ VclPtr<FixedText> mpFTArrow;
+ VclPtr<ListBox> mpLBStart;
+ VclPtr<ListBox> mpLBEnd;
+ VclPtr<FixedText> mpFTEdgeStyle;
+ VclPtr<ListBox> mpLBEdgeStyle;
+ VclPtr<FixedText> mpFTCapStyle;
+ VclPtr<ListBox> mpLBCapStyle;
+
+ std::unique_ptr<XLineStyleItem> mpStyleItem;
+ std::unique_ptr<XLineDashItem> mpDashItem;
+
+ sal_uInt16 mnTrans;
+ SfxMapUnit meMapUnit;
+ sal_Int32 mnWidthCoreValue;
+ XLineEndListRef mxLineEndList;
+ XDashListRef mxLineStyleList;
+ std::unique_ptr<XLineStartItem> mpStartItem;
+ std::unique_ptr<XLineEndItem> mpEndItem;
+
+ //popup windows
+ LineWidthPopup maLineWidthPopup;
+
+ // images from resource
+ Image maIMGNone;
+
+ // multi-images
+ std::unique_ptr<Image[]> mpIMGWidthIcon;
+
+ css::uno::Reference<css::frame::XFrame> mxFrame;
+
+ /// bitfield
+ bool mbWidthValuable : 1;
+
+ void Initialize();
+
+ DECL_LINK(ChangeLineStyleHdl, void*);
+ DECL_LINK_TYPED(ToolboxWidthSelectHdl, ToolBox*, void);
+ DECL_LINK(ChangeTransparentHdl , void *);
+ DECL_LINK(ChangeStartHdl, void *);
+ DECL_LINK(ChangeEndHdl, void *);
+ DECL_LINK(ChangeEdgeStyleHdl, void *);
+ DECL_LINK(ChangeCapStyleHdl, void *);
+
+ VclPtr<PopupControl> CreateLineWidthPopupControl (PopupContainer* pParent);
+};
+
+} } // end of namespace svx::sidebar
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/line/LineWidthControl.cxx b/svx/source/sidebar/line/LineWidthControl.cxx
index 7d026fd..2bee185 100644
--- a/svx/source/sidebar/line/LineWidthControl.cxx
+++ b/svx/source/sidebar/line/LineWidthControl.cxx
@@ -18,7 +18,7 @@
*/
#include "LineWidthControl.hxx"
#include "LinePropertyPanel.hrc"
-#include "LinePropertyPanel.hxx"
+#include "LinePropertyPanelBase.hxx"
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
@@ -36,10 +36,9 @@ namespace svx { namespace sidebar {
LineWidthControl::LineWidthControl (
vcl::Window* pParent,
- LinePropertyPanel& rPanel)
+ LinePropertyPanelBase& rPanel)
: svx::sidebar::PopupControl(pParent,SVX_RES(RID_POPUPPANEL_LINEPAGE_WIDTH)),
mrLinePropertyPanel(rPanel),
- mpBindings(NULL),
maVSWidth(VclPtr<LineWidthValueSet>::Create(this, SVX_RES(VS_WIDTH))),
maFTCus( VclPtr<FixedText>::Create(this, SVX_RES(FT_CUSTOME))),
maFTWidth( VclPtr<FixedText>::Create(this, SVX_RES(FT_LINE_WIDTH))),
@@ -57,7 +56,6 @@ LineWidthControl::LineWidthControl (
{
Initialize();
FreeResource();
- mpBindings = mrLinePropertyPanel.GetBindings();
}
LineWidthControl::~LineWidthControl()
@@ -268,7 +266,7 @@ IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl)
sal_IntPtr nVal = LogicToLogic(reinterpret_cast<sal_IntPtr>(maVSWidth->GetItemData( iPos )), MAP_POINT, (MapUnit)meMapUnit);
nVal = maMFWidth->Denormalize(nVal);
XLineWidthItem aWidthItem( nVal );
- mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_WIDTH, SfxCallMode::RECORD, &aWidthItem, 0L);
+ mrLinePropertyPanel.setLineWidth(aWidthItem);
mrLinePropertyPanel.SetWidthIcon(iPos);
mrLinePropertyPanel.SetWidth(nVal);
mbCloseByEdit = false;
@@ -282,7 +280,7 @@ IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl)
long nVal = LogicToLogic(mnCustomWidth , MAP_POINT, (MapUnit)meMapUnit);
nVal = maMFWidth->Denormalize(nVal);
XLineWidthItem aWidthItem( nVal );
- mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_WIDTH, SfxCallMode::RECORD, &aWidthItem, 0L);
+ mrLinePropertyPanel.setLineWidth(aWidthItem);
mrLinePropertyPanel.SetWidth(nVal);
mbCloseByEdit = false;
mnTmpCustomWidth = 0;
@@ -319,7 +317,7 @@ IMPL_LINK(LineWidthControl, MFModifyHdl, void *, pControl)
long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)meMapUnit );
sal_Int32 nNewWidth = (short)maMFWidth->Denormalize( nVal );
XLineWidthItem aWidthItem(nNewWidth);
- mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_WIDTH, SfxCallMode::RECORD, &aWidthItem, 0L);
+ mrLinePropertyPanel.setLineWidth(aWidthItem);
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list