summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-12-31 10:26:43 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-01-04 14:44:33 +0000
commitf14d64fa71565e86c98348f9c54cc6cab53649d8 (patch)
tree830034b8c4ac9e9bf83f049fabb3138f9a854486 /sw/source
parent549e900b4b0047b8cb6c236ea50a3fc046e5fb51 (diff)
these fields can be static constants
Change-Id: Id56e219782d7f858cdeb26232c7aabd4f643c9d9 Reviewed-on: https://gerrit.libreoffice.org/21020 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/inc/unoevent.hxx2
-rw-r--r--sw/source/core/unocore/unoevent.cxx5
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.cxx39
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.hxx3
-rw-r--r--sw/source/filter/xml/xmlexp.cxx4
-rw-r--r--sw/source/filter/xml/xmlexp.hxx4
-rw-r--r--sw/source/filter/xml/xmltble.cxx8
7 files changed, 29 insertions, 36 deletions
diff --git a/sw/source/core/inc/unoevent.hxx b/sw/source/core/inc/unoevent.hxx
index d942c6065dbd..f0da67bc7afb 100644
--- a/sw/source/core/inc/unoevent.hxx
+++ b/sw/source/core/inc/unoevent.hxx
@@ -34,8 +34,6 @@ class SwFormatINetFormat;
class SwHyperlinkEventDescriptor : public SvDetachedEventDescriptor
{
- const OUString sImplName;
-
//XServiceInfo
virtual OUString SAL_CALL getImplementationName()
throw( css::uno::RuntimeException, std::exception ) override;
diff --git a/sw/source/core/unocore/unoevent.cxx b/sw/source/core/unocore/unoevent.cxx
index 53f311f7d3ea..bb6c1eebd2c0 100644
--- a/sw/source/core/unocore/unoevent.cxx
+++ b/sw/source/core/unocore/unoevent.cxx
@@ -101,8 +101,7 @@ const struct SvEventDescription aFrameStyleEvents[] =
};
SwHyperlinkEventDescriptor::SwHyperlinkEventDescriptor() :
- SvDetachedEventDescriptor(aHyperlinkEvents),
- sImplName("SwHyperlinkEventDescriptor")
+ SvDetachedEventDescriptor(aHyperlinkEvents)
{
}
@@ -113,7 +112,7 @@ SwHyperlinkEventDescriptor::~SwHyperlinkEventDescriptor()
OUString SwHyperlinkEventDescriptor::getImplementationName()
throw( RuntimeException, std::exception )
{
- return sImplName;
+ return OUString("SwHyperlinkEventDescriptor");
}
void SwHyperlinkEventDescriptor::copyMacrosFromINetFormat(
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 73b6d293d3f3..af85125689db 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -236,6 +236,10 @@ RedlineInfo::~RedlineInfo()
delete pNextRedline;
}
+static const char g_sShowChanges[] = "ShowChanges";
+static const char g_sRecordChanges[] = "RecordChanges";
+static const char g_sRedlineProtectionKey[] = "RedlineProtectionKey";
+
XMLRedlineImportHelper::XMLRedlineImportHelper(
bool bNoRedlinesPlease,
const Reference<XPropertySet> & rModel,
@@ -243,9 +247,6 @@ XMLRedlineImportHelper::XMLRedlineImportHelper(
sInsertion( GetXMLToken( XML_INSERTION )),
sDeletion( GetXMLToken( XML_DELETION )),
sFormatChange( GetXMLToken( XML_FORMAT_CHANGE )),
- sShowChanges("ShowChanges"),
- sRecordChanges("RecordChanges"),
- sRedlineProtectionKey("RedlineProtectionKey"),
aRedlineMap(),
bIgnoreRedlines(bNoRedlinesPlease),
xModelPropertySet(rModel),
@@ -260,29 +261,29 @@ XMLRedlineImportHelper::XMLRedlineImportHelper(
Reference<XPropertySetInfo> xInfo =
xImportInfoPropertySet->getPropertySetInfo();
- bHandleShowChanges = ! xInfo->hasPropertyByName( sShowChanges );
- bHandleRecordChanges = ! xInfo->hasPropertyByName( sRecordChanges );
- bHandleProtectionKey = ! xInfo->hasPropertyByName( sRedlineProtectionKey );
+ bHandleShowChanges = ! xInfo->hasPropertyByName( g_sShowChanges );
+ bHandleRecordChanges = ! xInfo->hasPropertyByName( g_sRecordChanges );
+ bHandleProtectionKey = ! xInfo->hasPropertyByName( g_sRedlineProtectionKey );
}
// get redline mode
bShowChanges = *static_cast<sal_Bool const *>(
( bHandleShowChanges ? xModelPropertySet : xImportInfoPropertySet )
- ->getPropertyValue( sShowChanges ).getValue());
+ ->getPropertyValue( g_sShowChanges ).getValue());
bRecordChanges = *static_cast<sal_Bool const *>(
( bHandleRecordChanges ? xModelPropertySet : xImportInfoPropertySet )
- ->getPropertyValue( sRecordChanges ).getValue());
+ ->getPropertyValue( g_sRecordChanges ).getValue());
{
Any aAny = (bHandleProtectionKey ? xModelPropertySet
: xImportInfoPropertySet )
- ->getPropertyValue( sRedlineProtectionKey );
+ ->getPropertyValue( g_sRedlineProtectionKey );
aAny >>= aProtectionKey;
}
// set redline mode to "don't record changes"
if( bHandleRecordChanges )
{
- xModelPropertySet->setPropertyValue( sRecordChanges, makeAny(false) );
+ xModelPropertySet->setPropertyValue( g_sRecordChanges, makeAny(false) );
}
}
@@ -334,9 +335,9 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
Reference<XPropertySetInfo> xInfo =
xImportInfoPropertySet->getPropertySetInfo();
- bHandleShowChanges = ! xInfo->hasPropertyByName( sShowChanges );
- bHandleRecordChanges = ! xInfo->hasPropertyByName( sRecordChanges );
- bHandleProtectionKey = ! xInfo->hasPropertyByName( sRedlineProtectionKey );
+ bHandleShowChanges = ! xInfo->hasPropertyByName( g_sShowChanges );
+ bHandleRecordChanges = ! xInfo->hasPropertyByName( g_sRecordChanges );
+ bHandleProtectionKey = ! xInfo->hasPropertyByName( g_sRedlineProtectionKey );
}
// set redline mode & key
@@ -346,21 +347,21 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
aAny <<= bShowChanges;
if ( bHandleShowChanges )
- xModelPropertySet->setPropertyValue( sShowChanges, aAny );
+ xModelPropertySet->setPropertyValue( g_sShowChanges, aAny );
else
- xImportInfoPropertySet->setPropertyValue( sShowChanges, aAny );
+ xImportInfoPropertySet->setPropertyValue( g_sShowChanges, aAny );
aAny <<= bRecordChanges;
if ( bHandleRecordChanges )
- xModelPropertySet->setPropertyValue( sRecordChanges, aAny );
+ xModelPropertySet->setPropertyValue( g_sRecordChanges, aAny );
else
- xImportInfoPropertySet->setPropertyValue( sRecordChanges, aAny );
+ xImportInfoPropertySet->setPropertyValue( g_sRecordChanges, aAny );
aAny <<= aProtectionKey;
if ( bHandleProtectionKey )
- xModelPropertySet->setPropertyValue( sRedlineProtectionKey, aAny );
+ xModelPropertySet->setPropertyValue( g_sRedlineProtectionKey, aAny );
else
- xImportInfoPropertySet->setPropertyValue( sRedlineProtectionKey, aAny);
+ xImportInfoPropertySet->setPropertyValue( g_sRedlineProtectionKey, aAny);
}
catch (const uno::RuntimeException &) // fdo#65882
{
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.hxx b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
index 34761167191b..f78866b692f9 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.hxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
@@ -43,9 +43,6 @@ class XMLRedlineImportHelper
const OUString sInsertion;
const OUString sDeletion;
const OUString sFormatChange;
- const OUString sShowChanges;
- const OUString sRecordChanges;
- const OUString sRedlineProtectionKey;
RedlineMapType aRedlineMap;
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 7dd8d1bfba31..4a3d4796dabd 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -92,9 +92,7 @@ SwXMLExport::SwXMLExport(
bBlock( false ),
bShowProgress( true ),
bSavedShowChanges( false ),
- doc( nullptr ),
- sNumberFormat("NumberFormat"),
- sIsProtected("IsProtected")
+ doc( nullptr )
{
_InitItemExport();
}
diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx
index 2f8a1e615869..b6d0da46c7e4 100644
--- a/sw/source/filter/xml/xmlexp.hxx
+++ b/sw/source/filter/xml/xmlexp.hxx
@@ -97,10 +97,6 @@ class SwXMLExport : public SvXMLExport
virtual void GetConfigurationSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
virtual sal_Int32 GetDocumentSpecificSettings( ::std::list< SettingsGroup >& _out_rSettings ) override;
- // string constants for table cell export
- const OUString sNumberFormat;
- const OUString sIsProtected;
-
void setBlockMode();
private:
void DeleteTableLines();
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 227ea830d9b2..47e6a0b1f41a 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -62,6 +62,10 @@ using table::XCell;
using ::std::vector;
using ::std::advance;
+// string constants for table cell export
+static const char g_sNumberFormat[] = "NumberFormat";
+static const char g_sIsProtected[] = "IsProtected";
+
class SwXMLTableColumn_Impl : public SwWriteTableCol
{
OUString sStyleName;
@@ -794,7 +798,7 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox,
if (xCellPropertySet.is())
{
sal_Int32 nNumberFormat = 0;
- Any aAny = xCellPropertySet->getPropertyValue(sNumberFormat);
+ Any aAny = xCellPropertySet->getPropertyValue(g_sNumberFormat);
aAny >>= nNumberFormat;
if (css::util::NumberFormat::TEXT == nNumberFormat)
@@ -814,7 +818,7 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox,
// else: invalid key; ignore
// cell protection
- aAny = xCellPropertySet->getPropertyValue(sIsProtected);
+ aAny = xCellPropertySet->getPropertyValue(g_sIsProtected);
if (*static_cast<sal_Bool const *>(aAny.getValue()))
{
AddAttribute( XML_NAMESPACE_TABLE, XML_PROTECTED,