summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-07-10 16:29:10 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-07-12 06:31:08 +0000
commit43bc09d6ddfafe4989f922ac2b41f0ac2bedc136 (patch)
treede5103d4c708b995d903cb096c1e89295f5b95a0 /chart2
parent0168bdc2310223fd8b7035a73d0fc850ecf07827 (diff)
chart2: make m_aEntryMap a non member constant
Change-Id: Ic45ba10808ea2ce6bc6520bb4222cd8b3ebd8ea6 Reviewed-on: https://gerrit.libreoffice.org/27098 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.cxx16
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.hxx3
2 files changed, 8 insertions, 11 deletions
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 7ff918745909..7bcb6053909a 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -40,6 +40,11 @@ namespace chart
namespace
{
+const OUString our_aLBEntryMap[] = {" ",
+ ", ",
+ "; ",
+ "\n"};
+
bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, sal_uInt16 nValueWhich, sal_uInt16 nSourceFormatWhich, sal_uLong& rnFormatKeyOut, bool& rbSourceFormatOut, bool& rbSourceFormatMixedStateOut )
{
bool bSet = false;
@@ -123,11 +128,6 @@ DataLabelResources::DataLabelResources(VclBuilderContainer* pWindow, vcl::Window
pWindow->get(m_pSeparatorResources, "boxSEPARATOR");
pWindow->get(m_pLB_Separator, "LB_TEXT_SEPARATOR");
- m_aEntryMap[0] = " ";
- m_aEntryMap[1] = ", ";
- m_aEntryMap[2] = "; ";
- m_aEntryMap[3] = "\n" ;
-
//fill label placement list
std::map< sal_Int32, OUString > aPlacementToStringMap;
for( sal_Int32 nEnum=0; nEnum<m_pLB_LabelPlacement->GetEntryCount(); ++nEnum )
@@ -298,7 +298,7 @@ bool DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const
if( m_pCBWrapText->GetState()!= TRISTATE_INDET )
rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_WRAP_TEXT, m_pCBWrapText->IsChecked()) );
- OUString aSep = m_aEntryMap[m_pLB_Separator->GetSelectEntryPos()];
+ OUString aSep = our_aLBEntryMap[m_pLB_Separator->GetSelectEntryPos()];
rOutAttrs->Put( SfxStringItem( SCHATTR_DATADESCR_SEPARATOR, aSep) );
::std::map< sal_uInt16, sal_Int32 >::const_iterator aIt( m_aListBoxToPlacementMap.find(m_pLB_LabelPlacement->GetSelectEntryPos()) );
@@ -336,9 +336,9 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
const SfxPoolItem *pPoolItem = nullptr;
if( rInAttrs.GetItemState(SCHATTR_DATADESCR_SEPARATOR, true, &pPoolItem) == SfxItemState::SET )
- for(sal_Int32 i=0; i < NUMBER_SEPARATORS; ++i )
+ for(sal_uInt32 i=0; i < SAL_N_ELEMENTS(our_aLBEntryMap); ++i )
{
- if( m_aEntryMap[i] == static_cast<const SfxStringItem*>(pPoolItem)->GetValue())
+ if( our_aLBEntryMap[i] == static_cast<const SfxStringItem*>(pPoolItem)->GetValue())
m_pLB_Separator->SelectEntryPos( i );
}
else
diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx
index e716320072dc..2f715e5a44f5 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.hxx
@@ -19,8 +19,6 @@
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_DATALABEL_HXX
#define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_RES_DATALABEL_HXX
-#define NUMBER_SEPARATORS 4
-
#include <vcl/button.hxx>
#include <vcl/layout.hxx>
#include <svl/itemset.hxx>
@@ -56,7 +54,6 @@ private:
VclPtr<VclHBox> m_pSeparatorResources;
VclPtr<ListBox> m_pLB_Separator;
- OUString m_aEntryMap[NUMBER_SEPARATORS];
VclPtr<VclHBox> m_pBxLabelPlacement;
VclPtr<ListBox> m_pLB_LabelPlacement;