[Libreoffice-commits] core.git: writerfilter/source
Matthew Pottage
matthewpottage at invincitech.com
Thu Jul 16 02:12:23 PDT 2015
writerfilter/source/dmapper/DomainMapper.cxx | 34
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 364 ++++-----
writerfilter/source/dmapper/DomainMapper_Impl.hxx | 7
writerfilter/source/dmapper/GraphicHelpers.cxx | 6
writerfilter/source/dmapper/GraphicImport.cxx | 91 +-
writerfilter/source/dmapper/ModelEventListener.cxx | 6
writerfilter/source/dmapper/NumberingManager.cxx | 34
writerfilter/source/dmapper/OLEHandler.cxx | 6
writerfilter/source/dmapper/PropertyIds.cxx | 761 +++++++++-----------
writerfilter/source/dmapper/PropertyIds.hxx | 15
writerfilter/source/dmapper/PropertyMap.cxx | 88 --
writerfilter/source/dmapper/StyleSheetTable.cxx | 36
writerfilter/source/dmapper/TrackChangesHandler.cxx | 18
13 files changed, 669 insertions(+), 797 deletions(-)
New commits:
commit 091f6c382394390206f784a5ec79842709e0f3bc
Author: Matthew Pottage <matthewpottage at invincitech.com>
Date: Wed Jul 1 16:51:45 2015 +0100
Removed singleton PropertyNameSupplier and replaced it with single function.
Measurements showed that the "optimisation" of caching PropertyIds and their
string equivalent leads to an increase of approx. 6 times in the total overall
time spent in PropertyNameSupplier::getName(eId), when running the unit tests.
PropertyNameSupplier was the only PropertyNameSupplier (no derived classes).
This means that getPropertyName can easily provide the same functionality.
Change-Id: I933b67c11d4cc35395a0c70e15f1c24ac9842ab0
Reviewed-on: https://gerrit.libreoffice.org/16665
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index becde28..8a875ae 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -104,13 +104,13 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon
{
// #i24363# tab stops relative to indent
m_pImpl->SetDocumentSettingsProperty(
- PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_TABS_RELATIVE_TO_INDENT ),
+ getPropertyName( PROP_TABS_RELATIVE_TO_INDENT ),
uno::makeAny( false ) );
m_pImpl->SetDocumentSettingsProperty(
- PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_SURROUND_TEXT_WRAP_SMALL ),
+ getPropertyName( PROP_SURROUND_TEXT_WRAP_SMALL ),
uno::makeAny( true ) );
m_pImpl->SetDocumentSettingsProperty(
- PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING ),
+ getPropertyName( PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING ),
uno::makeAny( true ) );
// Don't load the default style definitions to avoid weird mix
@@ -271,7 +271,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
{
uno::Reference< beans::XPropertySet > xAnchorProps( m_pImpl->GetTopContext()->GetFootnote()->getAnchor(), uno::UNO_QUERY );
xAnchorProps->setPropertyValue(
- PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_CHAR_FONT_NAME),
+ getPropertyName( PROP_CHAR_FONT_NAME),
uno::makeAny( sStringValue ));
}
else //a real symbol
@@ -1166,7 +1166,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
Value::Pointer_t pValue = rSprm.getValue();
sal_Int32 nIntValue = pValue->getInt();
const OUString sStringValue = pValue->getString();
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
switch(nSprmId)
{
@@ -1525,7 +1524,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
uno::Reference<beans::XPropertySet> xCharStyle(m_pImpl->GetCurrentNumberingCharStyle());
if (xCharStyle.is())
- xCharStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_CHAR_WEIGHT), aBold);
+ xCharStyle->setPropertyValue(getPropertyName(PROP_CHAR_WEIGHT), aBold);
if (nSprmId == NS_ooxml::LN_EG_RPrBase_b)
m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "b", OUString::number(nIntValue));
else if (nSprmId == NS_ooxml::LN_EG_RPrBase_bCs)
@@ -1605,7 +1604,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
uno::Reference<beans::XPropertySet> xCharStyle(m_pImpl->GetCurrentNumberingCharStyle());
if (xCharStyle.is())
- xCharStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_CHAR_HEIGHT), aVal);
+ xCharStyle->setPropertyValue(getPropertyName(PROP_CHAR_HEIGHT), aVal);
}
}
// Make sure char sizes defined in the stylesheets don't affect char props from direct formatting.
@@ -1865,13 +1864,12 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
{
uno::Reference< text::XLineNumberingProperties > xLineNumberingProperties( m_pImpl->GetTextDocument(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xLineNumberingPropSet = xLineNumberingProperties->getLineNumberingProperties();
- PropertyNameSupplier& rNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
- xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_IS_ON ), uno::makeAny(true) );
+ xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_IS_ON ), uno::makeAny(true) );
if( aSettings.nInterval )
- xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_INTERVAL ), uno::makeAny((sal_Int16)aSettings.nInterval) );
+ xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_INTERVAL ), uno::makeAny((sal_Int16)aSettings.nInterval) );
if( aSettings.nDistance )
- xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_DISTANCE ), uno::makeAny(aSettings.nDistance) );
- xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny(aSettings.bRestartAtEachPage) );
+ xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_DISTANCE ), uno::makeAny(aSettings.nDistance) );
+ xLineNumberingPropSet->setPropertyValue(getPropertyName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny(aSettings.bRestartAtEachPage) );
}
catch( const uno::Exception& )
{
@@ -1978,13 +1976,13 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
if( xTOC.is() )
{
uno::Reference<text::XTextColumns> xTextColumns;
- xTOC->getPropertyValue(rPropNameSupplier.GetName( PROP_TEXT_COLUMNS )) >>= xTextColumns;
+ xTOC->getPropertyValue(getPropertyName( PROP_TEXT_COLUMNS )) >>= xTextColumns;
if (xTextColumns.is())
{
uno::Reference< beans::XPropertySet > xColumnPropSet( xTextColumns, uno::UNO_QUERY_THROW );
if ( xColumnPropSet.is() )
- xColumnPropSet->setPropertyValue( rPropNameSupplier.GetName( PROP_AUTOMATIC_DISTANCE ), uno::makeAny( pSectHdl->GetSpace() ));
- xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_TEXT_COLUMNS ), uno::makeAny( xTextColumns ) );
+ xColumnPropSet->setPropertyValue( getPropertyName( PROP_AUTOMATIC_DISTANCE ), uno::makeAny( pSectHdl->GetSpace() ));
+ xTOC->setPropertyValue( getPropertyName( PROP_TEXT_COLUMNS ), uno::makeAny( xTextColumns ) );
}
}
}
@@ -2194,7 +2192,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
if( NS_ooxml::LN_EG_FtnEdnNumProps_numStart == nSprmId && xFtnEdnSettings.is())
{
xFtnEdnSettings->setPropertyValue(
- PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_START_AT),
+ getPropertyName( PROP_START_AT),
uno::makeAny( sal_Int16( nIntValue - 1 )));
}
else if( NS_ooxml::LN_EG_FtnEdnNumProps_numRestart == nSprmId && xFtnEdnSettings.is())
@@ -2208,14 +2206,14 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
default: break;
}
xFtnEdnSettings->setPropertyValue(
- PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_FOOTNOTE_COUNTING ),
+ getPropertyName( PROP_FOOTNOTE_COUNTING ),
uno::makeAny( nFootnoteCounting ));
}
else if (xFtnEdnSettings.is())
{
sal_Int16 nNumType = ConversionHelper::ConvertNumberingType( nIntValue );
xFtnEdnSettings->setPropertyValue(
- PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_NUMBERING_TYPE),
+ getPropertyName( PROP_NUMBERING_TYPE),
uno::makeAny( nNumType ));
}
}
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f8ae16d..cfa1b83 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -88,7 +88,7 @@ namespace writerfilter {
namespace dmapper{
//line numbering for header/footer
-void lcl_linenumberingHeaderFooter( PropertyNameSupplier& rPropNameSupplier, uno::Reference<container::XNameContainer> xStyles, const OUString& rname, DomainMapper_Impl* dmapper )
+void lcl_linenumberingHeaderFooter( uno::Reference<container::XNameContainer> xStyles, const OUString& rname, DomainMapper_Impl* dmapper )
{
const StyleSheetEntryPtr pEntry = dmapper->GetStyleSheetTable()->FindStyleSheetByISTD( rname );
if (!pEntry)
@@ -106,7 +106,7 @@ void lcl_linenumberingHeaderFooter( PropertyNameSupplier& rPropNameSupplier, uno
if( !xStyle.is() )
return;
uno::Reference<beans::XPropertySet> xPropertySet( xStyle, uno::UNO_QUERY );
- xPropertySet->setPropertyValue( rPropNameSupplier.GetName( PROP_PARA_LINE_NUMBER_COUNT ), uno::makeAny( ( bool )( nListId >= 0 ) ) );
+ xPropertySet->setPropertyValue( getPropertyName( PROP_PARA_LINE_NUMBER_COUNT ), uno::makeAny( ( bool )( nListId >= 0 ) ) );
}
}
}
@@ -133,18 +133,18 @@ void lcl_handleDropdownField( const uno::Reference< beans::XPropertySet >& rxFie
}
}
-void lcl_handleTextField( const uno::Reference< beans::XPropertySet >& rxFieldProps, FFDataHandler::Pointer_t pFFDataHandler, PropertyNameSupplier& rPropNameSupplier )
+void lcl_handleTextField( const uno::Reference< beans::XPropertySet >& rxFieldProps, FFDataHandler::Pointer_t pFFDataHandler )
{
if ( rxFieldProps.is() && pFFDataHandler )
{
rxFieldProps->setPropertyValue
- (rPropNameSupplier.GetName(PROP_HINT),
+ (getPropertyName(PROP_HINT),
uno::makeAny(pFFDataHandler->getStatusText()));
rxFieldProps->setPropertyValue
- (rPropNameSupplier.GetName(PROP_HELP),
+ (getPropertyName(PROP_HELP),
uno::makeAny(pFFDataHandler->getHelpText()));
rxFieldProps->setPropertyValue
- (rPropNameSupplier.GetName(PROP_CONTENT),
+ (getPropertyName(PROP_CONTENT),
uno::makeAny(pFFDataHandler->getTextDefault()));
}
}
@@ -776,10 +776,9 @@ void lcl_MoveBorderPropertiesToFrame(std::vector<beans::PropertyValue>& rFramePr
sal_uInt32 nBorderPropertyCount = sizeof( aBorderProperties ) / sizeof(PropertyIds);
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
for( sal_uInt32 nProperty = 0; nProperty < nBorderPropertyCount; ++nProperty)
{
- OUString sPropertyName = rPropNameSupplier.GetName(aBorderProperties[nProperty]);
+ OUString sPropertyName = getPropertyName(aBorderProperties[nProperty]);
beans::PropertyValue aValue;
aValue.Name = sPropertyName;
aValue.Value = xTextRangeProperties->getPropertyValue(sPropertyName);
@@ -826,7 +825,6 @@ void lcl_AddRangeAndStyle(
void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
{
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
if (m_aTextAppendStack.empty())
return;
TextAppendContext& rAppendContext = m_aTextAppendStack.top();
@@ -853,34 +851,34 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
bool bAutoWidth = nWidth < 1;
if( bAutoWidth )
nWidth = DEFAULT_FRAME_MIN_WIDTH;
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_WIDTH), nWidth));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_WIDTH), nWidth));
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_HEIGHT),
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HEIGHT),
rAppendContext.pLastParagraphProperties->Geth() > 0 ?
rAppendContext.pLastParagraphProperties->Geth() :
pStyleProperties->Geth() > 0 ? pStyleProperties->Geth() : DEFAULT_FRAME_MIN_HEIGHT));
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_SIZE_TYPE), sal_Int16(
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SIZE_TYPE), sal_Int16(
rAppendContext.pLastParagraphProperties->GethRule() >= 0 ?
rAppendContext.pLastParagraphProperties->GethRule() :
pStyleProperties->GethRule() >=0 ? pStyleProperties->GethRule() : text::SizeType::VARIABLE)));
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_WIDTH_TYPE), bAutoWidth ? text::SizeType::MIN : text::SizeType::FIX));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_WIDTH_TYPE), bAutoWidth ? text::SizeType::MIN : text::SizeType::FIX));
sal_Int16 nHoriOrient = sal_Int16(
rAppendContext.pLastParagraphProperties->GetxAlign() >= 0 ?
rAppendContext.pLastParagraphProperties->GetxAlign() :
pStyleProperties->GetxAlign() >= 0 ? pStyleProperties->GetxAlign() : text::HoriOrientation::NONE );
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_HORI_ORIENT), nHoriOrient));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HORI_ORIENT), nHoriOrient));
//set a non negative default value
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_HORI_ORIENT_POSITION),
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HORI_ORIENT_POSITION),
rAppendContext.pLastParagraphProperties->IsxValid() ?
rAppendContext.pLastParagraphProperties->Getx() :
pStyleProperties->IsxValid() ? pStyleProperties->Getx() : DEFAULT_VALUE));
//Default the anchor in case FramePr_hAnchor is missing ECMA 17.3.1.11
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_HORI_ORIENT_RELATION), sal_Int16(
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HORI_ORIENT_RELATION), sal_Int16(
rAppendContext.pLastParagraphProperties->GethAnchor() >= 0 ?
rAppendContext.pLastParagraphProperties->GethAnchor() :
pStyleProperties->GethAnchor() >=0 ? pStyleProperties->GethAnchor() : text::RelOrientation::FRAME )));
@@ -889,21 +887,21 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
rAppendContext.pLastParagraphProperties->GetyAlign() >= 0 ?
rAppendContext.pLastParagraphProperties->GetyAlign() :
pStyleProperties->GetyAlign() >= 0 ? pStyleProperties->GetyAlign() : text::VertOrientation::NONE );
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_VERT_ORIENT), nVertOrient));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT), nVertOrient));
//set a non negative default value
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_VERT_ORIENT_POSITION),
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_POSITION),
rAppendContext.pLastParagraphProperties->IsyValid() ?
rAppendContext.pLastParagraphProperties->Gety() :
pStyleProperties->IsyValid() ? pStyleProperties->Gety() : DEFAULT_VALUE));
//Default the anchor in case FramePr_vAnchor is missing ECMA 17.3.1.11
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_VERT_ORIENT_RELATION), sal_Int16(
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_RELATION), sal_Int16(
rAppendContext.pLastParagraphProperties->GetvAnchor() >= 0 ?
rAppendContext.pLastParagraphProperties->GetvAnchor() :
pStyleProperties->GetvAnchor() >= 0 ? pStyleProperties->GetvAnchor() : text::RelOrientation::FRAME )));
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_SURROUND), text::WrapTextMode(
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SURROUND), text::WrapTextMode(
rAppendContext.pLastParagraphProperties->GetWrap() >= 0 ?
rAppendContext.pLastParagraphProperties->GetWrap() :
pStyleProperties->GetWrap() >= 0 ? pStyleProperties->GetWrap() : 0 )));
@@ -918,8 +916,8 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
rAppendContext.pLastParagraphProperties->GethSpace() :
pStyleProperties->GethSpace() >= 0 ? pStyleProperties->GethSpace() : 0;
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_LEFT_MARGIN), nHoriOrient == text::HoriOrientation::LEFT ? 0 : nLeftDist));
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_RIGHT_MARGIN), nHoriOrient == text::HoriOrientation::RIGHT ? 0 : nRightDist));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_LEFT_MARGIN), nHoriOrient == text::HoriOrientation::LEFT ? 0 : nLeftDist));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_RIGHT_MARGIN), nHoriOrient == text::HoriOrientation::RIGHT ? 0 : nRightDist));
sal_Int32 nBottomDist;
sal_Int32 nTopDist = nBottomDist =
@@ -927,12 +925,12 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
rAppendContext.pLastParagraphProperties->GetvSpace() :
pStyleProperties->GetvSpace() >= 0 ? pStyleProperties->GetvSpace() : 0;
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_TOP_MARGIN), nVertOrient == text::VertOrientation::TOP ? 0 : nTopDist));
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_BOTTOM_MARGIN), nVertOrient == text::VertOrientation::BOTTOM ? 0 : nBottomDist));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_TOP_MARGIN), nVertOrient == text::VertOrientation::TOP ? 0 : nTopDist));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_BOTTOM_MARGIN), nVertOrient == text::VertOrientation::BOTTOM ? 0 : nBottomDist));
// If there is no fill, the Word default is 100% transparency.
// Otherwise CellColorHandler has priority, and this setting
// will be ignored.
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_BACK_COLOR_TRANSPARENCY), sal_Int32(100)));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_BACK_COLOR_TRANSPARENCY), sal_Int32(100)));
beans::PropertyValue aRet;
uno::Sequence<beans::PropertyValue> aGrabBag(1);
@@ -951,50 +949,50 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
bool bAutoWidth = nWidth < 1;
if( bAutoWidth )
nWidth = DEFAULT_FRAME_MIN_WIDTH;
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_WIDTH), nWidth));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_WIDTH), nWidth));
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_SIZE_TYPE), sal_Int16(
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SIZE_TYPE), sal_Int16(
rAppendContext.pLastParagraphProperties->GethRule() >= 0 ?
rAppendContext.pLastParagraphProperties->GethRule() :
text::SizeType::VARIABLE)));
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_WIDTH_TYPE), bAutoWidth ? text::SizeType::MIN : text::SizeType::FIX));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_WIDTH_TYPE), bAutoWidth ? text::SizeType::MIN : text::SizeType::FIX));
sal_Int16 nHoriOrient = sal_Int16(
rAppendContext.pLastParagraphProperties->GetxAlign() >= 0 ?
rAppendContext.pLastParagraphProperties->GetxAlign() :
text::HoriOrientation::NONE );
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_HORI_ORIENT), nHoriOrient));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HORI_ORIENT), nHoriOrient));
sal_Int16 nVertOrient = sal_Int16(
rAppendContext.pLastParagraphProperties->GetyAlign() >= 0 ?
rAppendContext.pLastParagraphProperties->GetyAlign() :
text::VertOrientation::NONE );
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_VERT_ORIENT), nVertOrient));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT), nVertOrient));
sal_Int32 nVertDist = rAppendContext.pLastParagraphProperties->GethSpace();
if( nVertDist < 0 )
nVertDist = 0;
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_LEFT_MARGIN), nVertOrient == text::VertOrientation::TOP ? 0 : nVertDist));
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_RIGHT_MARGIN), nVertOrient == text::VertOrientation::BOTTOM ? 0 : nVertDist));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_LEFT_MARGIN), nVertOrient == text::VertOrientation::TOP ? 0 : nVertDist));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_RIGHT_MARGIN), nVertOrient == text::VertOrientation::BOTTOM ? 0 : nVertDist));
sal_Int32 nHoriDist = rAppendContext.pLastParagraphProperties->GetvSpace();
if( nHoriDist < 0 )
nHoriDist = 0;
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_TOP_MARGIN), nHoriOrient == text::HoriOrientation::LEFT ? 0 : nHoriDist));
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_BOTTOM_MARGIN), nHoriOrient == text::HoriOrientation::RIGHT ? 0 : nHoriDist));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_TOP_MARGIN), nHoriOrient == text::HoriOrientation::LEFT ? 0 : nHoriDist));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_BOTTOM_MARGIN), nHoriOrient == text::HoriOrientation::RIGHT ? 0 : nHoriDist));
if( rAppendContext.pLastParagraphProperties->Geth() > 0 )
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_HEIGHT), rAppendContext.pLastParagraphProperties->Geth()));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HEIGHT), rAppendContext.pLastParagraphProperties->Geth()));
if( rAppendContext.pLastParagraphProperties->IsxValid() )
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_HORI_ORIENT_POSITION), rAppendContext.pLastParagraphProperties->Getx()));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HORI_ORIENT_POSITION), rAppendContext.pLastParagraphProperties->Getx()));
if( rAppendContext.pLastParagraphProperties->GethAnchor() >= 0 )
aFrameProperties.push_back(comphelper::makePropertyValue("HoriOrientRelation", sal_Int16(rAppendContext.pLastParagraphProperties->GethAnchor())));
if( rAppendContext.pLastParagraphProperties->IsyValid() )
- aFrameProperties.push_back(comphelper::makePropertyValue(rPropNameSupplier.GetName(PROP_VERT_ORIENT_POSITION), rAppendContext.pLastParagraphProperties->Gety()));
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_POSITION), rAppendContext.pLastParagraphProperties->Gety()));
if( rAppendContext.pLastParagraphProperties->GetvAnchor() >= 0 )
aFrameProperties.push_back(comphelper::makePropertyValue("VertOrientRelation", sal_Int16(rAppendContext.pLastParagraphProperties->GetvAnchor())));
@@ -1032,7 +1030,6 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
uno::Reference< text::XTextAppend > xTextAppend;
if (!m_aTextAppendStack.empty())
xTextAppend = rAppendContext.xTextAppend;
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
#ifdef DEBUG_WRITERFILTER
TagLogger::getInstance().attribute("isTextAppend", sal_uInt32(xTextAppend.is()));
@@ -1071,8 +1068,8 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
//select paragraph
xParaCursor->gotoStartOfParagraph( true );
uno::Reference< beans::XPropertyState > xParaProperties( xParaCursor, uno::UNO_QUERY_THROW );
- xParaProperties->setPropertyToDefault(rPropNameSupplier.GetName(PROP_CHAR_ESCAPEMENT));
- xParaProperties->setPropertyToDefault(rPropNameSupplier.GetName(PROP_CHAR_HEIGHT));
+ xParaProperties->setPropertyToDefault(getPropertyName(PROP_CHAR_ESCAPEMENT));
+ xParaProperties->setPropertyToDefault(getPropertyName(PROP_CHAR_HEIGHT));
//handles (2) and part of (6)
pToBeSavedProperties.reset( new ParagraphProperties(*pParaContext) );
sal_Int32 nCount = xParaCursor->getString().getLength();
@@ -1130,7 +1127,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
if( aDrop.Lines > 1 )
{
beans::PropertyValue aValue;
- aValue.Name = rPropNameSupplier.GetName(PROP_DROP_CAP_FORMAT);
+ aValue.Name = getPropertyName(PROP_DROP_CAP_FORMAT);
aValue.Value <<= aDrop;
aProperties.push_back(aValue);
}
@@ -1339,7 +1336,7 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, OLEHandlerPtr pO
OUString aCLSID = pOLEHandler->getCLSID(m_xComponentContext);
if (aCLSID.isEmpty())
- xOLEProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_STREAM_NAME ),
+ xOLEProperties->setPropertyValue(getPropertyName( PROP_STREAM_NAME ),
uno::makeAny( rStreamName ));
else
xOLEProperties->setPropertyValue("CLSID", uno::makeAny(OUString(aCLSID)));
@@ -1349,13 +1346,13 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, OLEHandlerPtr pO
aSize.Width = 1000;
if( !aSize.Height )
aSize.Height = 1000;
- xOLEProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_WIDTH ),
+ xOLEProperties->setPropertyValue(getPropertyName( PROP_WIDTH ),
uno::makeAny(aSize.Width));
- xOLEProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_HEIGHT ),
+ xOLEProperties->setPropertyValue(getPropertyName( PROP_HEIGHT ),
uno::makeAny(aSize.Height));
uno::Reference< graphic::XGraphic > xGraphic = pOLEHandler->getReplacement();
- xOLEProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_GRAPHIC ),
+ xOLEProperties->setPropertyValue(getPropertyName( PROP_GRAPHIC ),
uno::makeAny(xGraphic));
uno::Reference<beans::XPropertySet> xReplacementProperties(pOLEHandler->getShape(), uno::UNO_QUERY);
if (xReplacementProperties.is())
@@ -1374,7 +1371,7 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, OLEHandlerPtr pO
else
// mimic the treatment of graphics here.. it seems anchoring as character
// gives a better ( visually ) result
- xOLEProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ANCHOR_TYPE ), uno::makeAny( text::TextContentAnchorType_AS_CHARACTER ) );
+ xOLEProperties->setPropertyValue(getPropertyName( PROP_ANCHOR_TYPE ), uno::makeAny( text::TextContentAnchorType_AS_CHARACTER ) );
// remove ( if valid ) associated shape ( used for graphic replacement )
SAL_WARN_IF(m_aAnchoredStack.empty(), "writerfilter.dmapper", "no anchor stack");
if (!m_aAnchoredStack.empty())
@@ -1408,20 +1405,20 @@ void DomainMapper_Impl::appendStarMath( const Value& val )
uno::Reference< text::XTextContent > xStarMath( m_xTextFactory->createInstance(sEmbeddedService), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xStarMathProperties(xStarMath, uno::UNO_QUERY_THROW);
- xStarMathProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_EMBEDDED_OBJECT ),
+ xStarMathProperties->setPropertyValue(getPropertyName( PROP_EMBEDDED_OBJECT ),
val.getAny());
uno::Reference< uno::XInterface > xInterface( formula->getComponent(), uno::UNO_QUERY );
Size size( 1000, 1000 );
if( oox::FormulaImportBase* formulaimport = dynamic_cast< oox::FormulaImportBase* >( xInterface.get()))
size = formulaimport->getFormulaSize();
- xStarMathProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_WIDTH ),
+ xStarMathProperties->setPropertyValue(getPropertyName( PROP_WIDTH ),
uno::makeAny( sal_Int32(size.Width())));
- xStarMathProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_HEIGHT ),
+ xStarMathProperties->setPropertyValue(getPropertyName( PROP_HEIGHT ),
uno::makeAny( sal_Int32(size.Height())));
// mimic the treatment of graphics here.. it seems anchoring as character
// gives a better ( visually ) result
- xStarMathProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ANCHOR_TYPE ),
+ xStarMathProperties->setPropertyValue(getPropertyName( PROP_ANCHOR_TYPE ),
uno::makeAny( text::TextContentAnchorType_AS_CHARACTER ) );
appendTextContent( xStarMath, uno::Sequence< beans::PropertyValue >() );
}
@@ -1498,11 +1495,9 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::P
bool bFirst = eType == SectionPropertyMap::PAGE_FIRST;
if ((!bLeft && !GetSettingsTable()->GetEvenAndOddHeaders()) || (GetSettingsTable()->GetEvenAndOddHeaders()))
{
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
-
//switch on header/footer use
xPageStyle->setPropertyValue(
- rPropNameSupplier.GetName(ePropIsOn),
+ getPropertyName(ePropIsOn),
uno::makeAny(sal_True));
if (bFirst)
@@ -1512,18 +1507,18 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::P
{
// This is a first page and has a follow style, then enable the header/footer there as well to be consistent.
uno::Reference<beans::XPropertySet> xFollowStyle(GetPageStyles()->getByName(aFollowStyle), uno::UNO_QUERY);
- xFollowStyle->setPropertyValue(rPropNameSupplier.GetName(ePropIsOn), uno::makeAny(sal_True));
+ xFollowStyle->setPropertyValue(getPropertyName(ePropIsOn), uno::makeAny(sal_True));
}
}
// If the 'Different Even & Odd Pages' flag is turned on - do not ignore it
// Even if the 'Even' header/footer is blank - the flag should be imported (so it would look in LO like in Word)
if (!bFirst && GetSettingsTable()->GetEvenAndOddHeaders())
- xPageStyle->setPropertyValue(rPropNameSupplier.GetName(ePropShared), uno::makeAny(false));
+ xPageStyle->setPropertyValue(getPropertyName(ePropShared), uno::makeAny(false));
//set the interface
uno::Reference< text::XText > xText;
- xPageStyle->getPropertyValue(rPropNameSupplier.GetName(bLeft? ePropTextLeft: ePropText)) >>= xText;
+ xPageStyle->getPropertyValue(getPropertyName(bLeft? ePropTextLeft: ePropText)) >>= xText;
m_aTextAppendStack.push(TextAppendContext(uno::Reference< text::XTextAppend >(xText, uno::UNO_QUERY_THROW),
m_bIsNewDoc? uno::Reference<text::XTextCursor>(): m_xBodyText->createTextCursorByRange(xText->getStart())));
@@ -1636,20 +1631,19 @@ void DomainMapper_Impl::CreateRedline(uno::Reference<text::XTextRange> const& xR
try
{
OUString sType;
- PropertyNameSupplier & rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier( );
switch ( pRedline->m_nToken & 0xffff )
{
case XML_mod:
- sType = rPropNameSupplier.GetName( PROP_FORMAT );
+ sType = getPropertyName( PROP_FORMAT );
break;
case XML_ins:
- sType = rPropNameSupplier.GetName( PROP_INSERT );
+ sType = getPropertyName( PROP_INSERT );
break;
case XML_del:
- sType = rPropNameSupplier.GetName( PROP_DELETE );
+ sType = getPropertyName( PROP_DELETE );
break;
case XML_ParagraphFormat:
- sType = rPropNameSupplier.GetName( PROP_PARAGRAPH_FORMAT );
+ sType = getPropertyName( PROP_PARAGRAPH_FORMAT );
break;
default:
throw lang::IllegalArgumentException("illegal redline token type", nullptr, 0);
@@ -1657,11 +1651,11 @@ void DomainMapper_Impl::CreateRedline(uno::Reference<text::XTextRange> const& xR
uno::Reference < text::XRedline > xRedline( xRange, uno::UNO_QUERY_THROW );
beans::PropertyValues aRedlineProperties( 3 );
beans::PropertyValue * pRedlineProperties = aRedlineProperties.getArray( );
- pRedlineProperties[0].Name = rPropNameSupplier.GetName( PROP_REDLINE_AUTHOR );
+ pRedlineProperties[0].Name = getPropertyName( PROP_REDLINE_AUTHOR );
pRedlineProperties[0].Value <<= pRedline->m_sAuthor;
- pRedlineProperties[1].Name = rPropNameSupplier.GetName( PROP_REDLINE_DATE_TIME );
+ pRedlineProperties[1].Name = getPropertyName( PROP_REDLINE_DATE_TIME );
pRedlineProperties[1].Value <<= ConversionHelper::ConvertDateStringToDateTime( pRedline->m_sDate );
- pRedlineProperties[2].Name = rPropNameSupplier.GetName( PROP_REDLINE_REVERT_PROPERTIES );
+ pRedlineProperties[2].Name = getPropertyName( PROP_REDLINE_REVERT_PROPERTIES );
pRedlineProperties[2].Value <<= pRedline->m_aRevertProperties;
xRedline->makeRedline( sType, aRedlineProperties );
}
@@ -1862,12 +1856,10 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
m_aAnchoredStack.push(xTextContent);
uno::Reference<beans::XPropertySet> xShapePropertySet(xShape, uno::UNO_QUERY);
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
-
m_xEmbedded.set(m_xTextFactory->createInstance("com.sun.star.text.TextEmbeddedObject"), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xEmbeddedProperties(m_xEmbedded, uno::UNO_QUERY_THROW);
- xEmbeddedProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_EMBEDDED_OBJECT), xShapePropertySet->getPropertyValue(rPropNameSupplier.GetName(PROP_EMBEDDED_OBJECT)));
- xEmbeddedProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_ANCHOR_TYPE), uno::makeAny(text::TextContentAnchorType_AS_CHARACTER));
+ xEmbeddedProperties->setPropertyValue(getPropertyName(PROP_EMBEDDED_OBJECT), xShapePropertySet->getPropertyValue(getPropertyName(PROP_EMBEDDED_OBJECT)));
+ xEmbeddedProperties->setPropertyValue(getPropertyName(PROP_ANCHOR_TYPE), uno::makeAny(text::TextContentAnchorType_AS_CHARACTER));
// So that the original bitmap-only shape will be replaced by the embedded object.
m_aAnchoredStack.top().bToRemove = true;
m_aTextAppendStack.pop();
@@ -1884,14 +1876,12 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
uno::Reference< text::XTextContent > xTxtContent( xShape, uno::UNO_QUERY_THROW );
m_aAnchoredStack.push( xTxtContent );
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
-
uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW );
#ifdef DEBUG_WRITERFILTER
TagLogger::getInstance().unoPropertySet(xProps);
#endif
text::TextContentAnchorType nAnchorType(text::TextContentAnchorType_AT_PARAGRAPH);
- xProps->getPropertyValue(rPropNameSupplier.GetName( PROP_ANCHOR_TYPE )) >>= nAnchorType;
+ xProps->getPropertyValue(getPropertyName( PROP_ANCHOR_TYPE )) >>= nAnchorType;
bool checkZOrderStatus = false;
if (xSInfo->supportsService("com.sun.star.text.TextFrame"))
{
@@ -1947,7 +1937,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
PropertyMapPtr paragraphContext = GetTopContextOfType( CONTEXT_PARAGRAPH );
boost::optional<PropertyMap::Property> aPropMargin = paragraphContext->getProperty(PROP_PARA_BOTTOM_MARGIN);
if(aPropMargin)
- xProps->setPropertyValue( rPropNameSupplier.GetName( PROP_BOTTOM_MARGIN ), aPropMargin->second );
+ xProps->setPropertyValue( getPropertyName( PROP_BOTTOM_MARGIN ), aPropMargin->second );
}
else
{
@@ -1963,7 +1953,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
aGrabBag[i].Value >>= zOrder;
xShapePropertySet->setPropertyValue( "ZOrder", uno::makeAny(pZOrderHelper->findZOrder(zOrder)));
pZOrderHelper->addItem(xShapePropertySet, zOrder);
- xShapePropertySet->setPropertyValue(rPropNameSupplier.GetName( PROP_OPAQUE ), uno::makeAny( false ) );
+ xShapePropertySet->setPropertyValue(getPropertyName( PROP_OPAQUE ), uno::makeAny( false ) );
checkZOrderStatus = true;
}
else if ( aGrabBag[i].Name == "TxbxHasLink" )
@@ -1996,7 +1986,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
}
if (!m_bInHeaderFooterImport && !checkZOrderStatus)
xProps->setPropertyValue(
- rPropNameSupplier.GetName( PROP_OPAQUE ),
+ getPropertyName( PROP_OPAQUE ),
uno::makeAny( true ) );
}
m_bParaChanged = true;
@@ -2015,11 +2005,10 @@ void DomainMapper_Impl::UpdateEmbeddedShapeProps(const uno::Reference< drawing::
if (!xShape.is())
return;
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
uno::Reference<beans::XPropertySet> xEmbeddedProperties(m_xEmbedded, uno::UNO_QUERY_THROW);
awt::Size aSize = xShape->getSize( );
- xEmbeddedProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_WIDTH), uno::makeAny(sal_Int32(aSize.Width)));
- xEmbeddedProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_HEIGHT), uno::makeAny(sal_Int32(aSize.Height)));
+ xEmbeddedProperties->setPropertyValue(getPropertyName(PROP_WIDTH), uno::makeAny(sal_Int32(aSize.Width)));
+ xEmbeddedProperties->setPropertyValue(getPropertyName(PROP_HEIGHT), uno::makeAny(sal_Int32(aSize.Height)));
}
@@ -2439,10 +2428,10 @@ void DomainMapper_Impl::SetNumberFormat( const OUString& rCommand,
nKey = xNumberSupplier->getNumberFormats()->addNewConverted( sFormat, aUSLocale, aCurrentLocale );
}
xPropertySet->setPropertyValue(
- PropertyNameSupplier::GetPropertyNameSupplier().GetName(PROP_NUMBER_FORMAT),
+ getPropertyName(PROP_NUMBER_FORMAT),
uno::makeAny( nKey ));
xPropertySet->getPropertyValue(
- PropertyNameSupplier::GetPropertyNameSupplier().GetName(PROP_NUMBER_FORMAT ) ) >>= nKey;
+ getPropertyName(PROP_NUMBER_FORMAT ) ) >>= nKey;
}
catch(const uno::Exception&)
{
@@ -2634,7 +2623,7 @@ uno::Reference<beans::XPropertySet> DomainMapper_Impl::FindOrCreateFieldMaster(c
m_xTextFactory->createInstance(sFieldMasterService), uno::UNO_QUERY_THROW);
//set the master's name
xMaster->setPropertyValue(
- PropertyNameSupplier::GetPropertyNameSupplier().GetName(PROP_NAME),
+ getPropertyName(PROP_NAME),
uno::makeAny(rFieldMasterName));
}
return xMaster;
@@ -2905,7 +2894,6 @@ const FieldConversionMap_t & lcl_GetEnhancedFieldConversion()
void DomainMapper_Impl::handleFieldAsk
(FieldContextPtr pContext,
- PropertyNameSupplier& rPropNameSupplier,
uno::Reference< uno::XInterface > & xFieldInterface,
uno::Reference< beans::XPropertySet > const& xFieldProperties)
{
@@ -2921,7 +2909,7 @@ void DomainMapper_Impl::handleFieldAsk
FindOrCreateFieldMaster
("com.sun.star.text.FieldMaster.SetExpression", sVariable );
// An ASK field is always a string of characters
- xMaster->setPropertyValue(rPropNameSupplier.GetName(PROP_SUB_TYPE), uno::makeAny(text::SetVariableType::STRING));
+ xMaster->setPropertyValue(getPropertyName(PROP_SUB_TYPE), uno::makeAny(text::SetVariableType::STRING));
// attach the master to the field
uno::Reference< text::XDependentTextField > xDependentField
@@ -2930,14 +2918,14 @@ void DomainMapper_Impl::handleFieldAsk
// set input flag at the field
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_IS_INPUT), uno::makeAny( true ));
+ getPropertyName(PROP_IS_INPUT), uno::makeAny( true ));
// set the prompt
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_HINT),
+ getPropertyName(PROP_HINT),
uno::makeAny( sHint ));
- xFieldProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_SUB_TYPE), uno::makeAny(text::SetVariableType::STRING));
+ xFieldProperties->setPropertyValue(getPropertyName(PROP_SUB_TYPE), uno::makeAny(text::SetVariableType::STRING));
// The ASK has no field value to display
- xFieldProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_IS_VISIBLE), uno::makeAny(sal_False));
+ xFieldProperties->setPropertyValue(getPropertyName(PROP_IS_VISIBLE), uno::makeAny(sal_False));
}
else
{
@@ -2949,7 +2937,6 @@ void DomainMapper_Impl::handleFieldAsk
void DomainMapper_Impl::handleAutoNum
(FieldContextPtr pContext,
- PropertyNameSupplier& rPropNameSupplier,
uno::Reference< uno::XInterface > & xFieldInterface,
uno::Reference< beans::XPropertySet > const& xFieldProperties)
{
@@ -2959,12 +2946,12 @@ void DomainMapper_Impl::handleAutoNum
("com.sun.star.text.FieldMaster.SetExpression",
"AutoNr");
- xMaster->setPropertyValue( rPropNameSupplier.GetName(PROP_SUB_TYPE),
+ xMaster->setPropertyValue( getPropertyName(PROP_SUB_TYPE),
uno::makeAny(text::SetVariableType::SEQUENCE));
//apply the numbering type
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_NUMBERING_TYPE),
+ getPropertyName(PROP_NUMBERING_TYPE),
uno::makeAny( lcl_ParseNumberingType(pContext->GetCommand()) ));
// attach the master to the field
uno::Reference< text::XDependentTextField > xDependentField
@@ -2974,19 +2961,18 @@ void DomainMapper_Impl::handleAutoNum
void DomainMapper_Impl::handleAuthor
(OUString const& rFirstParam,
- PropertyNameSupplier& rPropNameSupplier,
uno::Reference< uno::XInterface > & /*xFieldInterface*/,
uno::Reference< beans::XPropertySet > const& xFieldProperties,
FieldId eFieldId )
{
if ( eFieldId != FIELD_USERINITIALS )
xFieldProperties->setPropertyValue
- ( rPropNameSupplier.GetName(PROP_FULL_NAME), uno::makeAny( true ));
+ ( getPropertyName(PROP_FULL_NAME), uno::makeAny( true ));
if (!rFirstParam.isEmpty())
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName( PROP_IS_FIXED ),
+ getPropertyName( PROP_IS_FIXED ),
uno::makeAny( true ));
//PROP_CURRENT_PRESENTATION is set later anyway
}
@@ -2995,7 +2981,6 @@ void DomainMapper_Impl::handleAuthor
void DomainMapper_Impl::handleDocProperty
(FieldContextPtr pContext,
OUString const& rFirstParam,
- PropertyNameSupplier& rPropNameSupplier,
uno::Reference< uno::XInterface > & xFieldInterface,
uno::Reference< beans::XPropertySet > const&)
{
@@ -3074,23 +3059,23 @@ void DomainMapper_Impl::handleAuthor
if( bIsCustomField )
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_NAME), uno::makeAny(rFirstParam));
+ getPropertyName(PROP_NAME), uno::makeAny(rFirstParam));
pContext->SetCustomField( xFieldProperties );
}
else
{
if(0 != (aDocProperties[nMap].nFlags & SET_ARABIC))
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_NUMBERING_TYPE),
+ getPropertyName(PROP_NUMBERING_TYPE),
uno::makeAny( style::NumberingType::ARABIC ));
else if(0 != (aDocProperties[nMap].nFlags & SET_FULL_NAME))
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_FULL_NAME),
+ getPropertyName(PROP_FULL_NAME),
uno::makeAny( true ));
else if(0 != (aDocProperties[nMap].nFlags & SET_DATE))
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_IS_DATE),
+ getPropertyName(PROP_IS_DATE),
uno::makeAny( true ));
SetNumberFormat( pContext->GetCommand(), xFieldProperties );
}
@@ -3103,8 +3088,7 @@ void DomainMapper_Impl::handleAuthor
}
uno::Sequence< beans::PropertyValues > lcl_createTOXLevelHyperlinks( bool bHyperlinks, const OUString& sChapterNoSeparator,
- const uno::Sequence< beans::PropertyValues >& aLevel,
- PropertyNameSupplier& rPropNameSupplier )
+ const uno::Sequence< beans::PropertyValues >& aLevel )
{
//create a copy of the level and add two new entries - hyperlink start and end
bool bChapterNoSeparator = !sChapterNoSeparator.isEmpty();
@@ -3114,26 +3098,26 @@ uno::Sequence< beans::PropertyValues > lcl_createTOXLevelHyperlinks( bool bHyper
if( bHyperlinks )
{
beans::PropertyValues aHyperlink(1);
- aHyperlink[0].Name = rPropNameSupplier.GetName( PROP_TOKEN_TYPE );
- aHyperlink[0].Value <<= rPropNameSupplier.GetName( PROP_TOKEN_HYPERLINK_START );
+ aHyperlink[0].Name = getPropertyName( PROP_TOKEN_TYPE );
+ aHyperlink[0].Value <<= getPropertyName( PROP_TOKEN_HYPERLINK_START );
pNewLevel[0] = aHyperlink;
- aHyperlink[0].Value <<= rPropNameSupplier.GetName( PROP_TOKEN_HYPERLINK_END );
+ aHyperlink[0].Value <<= getPropertyName( PROP_TOKEN_HYPERLINK_END );
pNewLevel[aNewLevel.getLength() -1] = aHyperlink;
}
if( bChapterNoSeparator )
{
beans::PropertyValues aChapterNo(2);
- aChapterNo[0].Name = rPropNameSupplier.GetName( PROP_TOKEN_TYPE );
- aChapterNo[0].Value <<= rPropNameSupplier.GetName( PROP_TOKEN_CHAPTER_INFO );
- aChapterNo[1].Name = rPropNameSupplier.GetName( PROP_CHAPTER_FORMAT );
+ aChapterNo[0].Name = getPropertyName( PROP_TOKEN_TYPE );
+ aChapterNo[0].Value <<= getPropertyName( PROP_TOKEN_CHAPTER_INFO );
+ aChapterNo[1].Name = getPropertyName( PROP_CHAPTER_FORMAT );
//todo: is ChapterFormat::Number correct?
aChapterNo[1].Value <<= (sal_Int16)text::ChapterFormat::NUMBER;
pNewLevel[aNewLevel.getLength() - (bHyperlinks ? 4 : 2) ] = aChapterNo;
beans::PropertyValues aChapterSeparator(2);
- aChapterSeparator[0].Name = rPropNameSupplier.GetName( PROP_TOKEN_TYPE );
- aChapterSeparator[0].Value <<= rPropNameSupplier.GetName( PROP_TOKEN_TEXT );
- aChapterSeparator[1].Name = rPropNameSupplier.GetName( PROP_TEXT );
+ aChapterSeparator[0].Name = getPropertyName( PROP_TOKEN_TYPE );
+ aChapterSeparator[0].Value <<= getPropertyName( PROP_TOKEN_TEXT );
+ aChapterSeparator[1].Name = getPropertyName( PROP_TEXT );
aChapterSeparator[1].Value <<= sChapterNoSeparator;
pNewLevel[aNewLevel.getLength() - (bHyperlinks ? 3 : 1)] = aChapterSeparator;
}
@@ -3151,7 +3135,6 @@ uno::Sequence< beans::PropertyValues > lcl_createTOXLevelHyperlinks( bool bHyper
void DomainMapper_Impl::handleToc
(FieldContextPtr pContext,
- PropertyNameSupplier& rPropNameSupplier,
uno::Reference< uno::XInterface > & /*xFieldInterface*/,
uno::Reference< beans::XPropertySet > const& /*xFieldProperties*/,
const OUString & sTOCServiceName)
@@ -3284,18 +3267,18 @@ void DomainMapper_Impl::handleToc
: sTOCServiceName),
uno::UNO_QUERY_THROW);
if (xTOC.is())
- xTOC->setPropertyValue(rPropNameSupplier.GetName( PROP_TITLE ), uno::makeAny(OUString()));
+ xTOC->setPropertyValue(getPropertyName( PROP_TITLE ), uno::makeAny(OUString()));
if (!aBookmarkName.isEmpty())
- xTOC->setPropertyValue(rPropNameSupplier.GetName(PROP_TOC_BOOKMARK), uno::makeAny(aBookmarkName));
+ xTOC->setPropertyValue(getPropertyName(PROP_TOC_BOOKMARK), uno::makeAny(aBookmarkName));
if( !bTableOfFigures && xTOC.is() )
{
- xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_LEVEL ), uno::makeAny( nMaxLevel ) );
- xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_CREATE_FROM_OUTLINE ), uno::makeAny( bFromOutline ));
- xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_CREATE_FROM_MARKS ), uno::makeAny( bFromEntries ));
- xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_HIDE_TAB_LEADER_AND_PAGE_NUMBERS ), uno::makeAny( bHideTabLeaderPageNumbers ));
- xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_TAB_IN_TOC ), uno::makeAny( bIsTabEntry ));
- xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_TOC_NEW_LINE ), uno::makeAny( bNewLine ));
- xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_TOC_PARAGRAPH_OUTLINE_LEVEL ), uno::makeAny( bParagraphOutlineLevel ));
+ xTOC->setPropertyValue( getPropertyName( PROP_LEVEL ), uno::makeAny( nMaxLevel ) );
+ xTOC->setPropertyValue( getPropertyName( PROP_CREATE_FROM_OUTLINE ), uno::makeAny( bFromOutline ));
+ xTOC->setPropertyValue( getPropertyName( PROP_CREATE_FROM_MARKS ), uno::makeAny( bFromEntries ));
+ xTOC->setPropertyValue( getPropertyName( PROP_HIDE_TAB_LEADER_AND_PAGE_NUMBERS ), uno::makeAny( bHideTabLeaderPageNumbers ));
+ xTOC->setPropertyValue( getPropertyName( PROP_TAB_IN_TOC ), uno::makeAny( bIsTabEntry ));
+ xTOC->setPropertyValue( getPropertyName( PROP_TOC_NEW_LINE ), uno::makeAny( bNewLine ));
+ xTOC->setPropertyValue( getPropertyName( PROP_TOC_PARAGRAPH_OUTLINE_LEVEL ), uno::makeAny( bParagraphOutlineLevel ));
if( !sTemplate.isEmpty() )
{
//the string contains comma separated the names and related levels
@@ -3316,7 +3299,7 @@ void DomainMapper_Impl::handleToc
aMap.insert( TOCStyleMap::value_type(nLevel, sStyleName) );
}
uno::Reference< container::XIndexReplace> xParaStyles;
- xTOC->getPropertyValue(rPropNameSupplier.GetName(PROP_LEVEL_PARAGRAPH_STYLES)) >>= xParaStyles;
+ xTOC->getPropertyValue(getPropertyName(PROP_LEVEL_PARAGRAPH_STYLES)) >>= xParaStyles;
for( nLevel = 1; nLevel < 10; ++nLevel)
{
sal_Int32 nLevelCount = aMap.count( nLevel );
@@ -3332,13 +3315,13 @@ void DomainMapper_Impl::handleToc
xParaStyles->replaceByIndex(nLevel - 1, uno::makeAny(aStyles));
}
}
- xTOC->setPropertyValue(rPropNameSupplier.GetName(PROP_CREATE_FROM_LEVEL_PARAGRAPH_STYLES), uno::makeAny( true ));
+ xTOC->setPropertyValue(getPropertyName(PROP_CREATE_FROM_LEVEL_PARAGRAPH_STYLES), uno::makeAny( true ));
}
if(bHyperlinks || !sChapterNoSeparator.isEmpty())
{
uno::Reference< container::XIndexReplace> xLevelFormats;
- xTOC->getPropertyValue(rPropNameSupplier.GetName(PROP_LEVEL_FORMAT)) >>= xLevelFormats;
+ xTOC->getPropertyValue(getPropertyName(PROP_LEVEL_FORMAT)) >>= xLevelFormats;
sal_Int32 nLevelCount = xLevelFormats->getCount();
//start with level 1, 0 is the header level
for( sal_Int32 nLevel = 1; nLevel < nLevelCount; ++nLevel)
@@ -3348,7 +3331,7 @@ void DomainMapper_Impl::handleToc
uno::Sequence< beans::PropertyValues > aNewLevel = lcl_createTOXLevelHyperlinks(
bHyperlinks, sChapterNoSeparator,
- aLevel, rPropNameSupplier );
+ aLevel );
xLevelFormats->replaceByIndex( nLevel, uno::makeAny( aNewLevel ) );
}
}
@@ -3356,19 +3339,19 @@ void DomainMapper_Impl::handleToc
else if (bTableOfFigures && xTOC.is())
{
if (!sFigureSequence.isEmpty())
- xTOC->setPropertyValue(rPropNameSupplier.GetName(PROP_LABEL_CATEGORY),
+ xTOC->setPropertyValue(getPropertyName(PROP_LABEL_CATEGORY),
uno::makeAny(sFigureSequence));
if ( bHyperlinks )
{
uno::Reference< container::XIndexReplace> xLevelFormats;
- xTOC->getPropertyValue(rPropNameSupplier.GetName(PROP_LEVEL_FORMAT)) >>= xLevelFormats;
+ xTOC->getPropertyValue(getPropertyName(PROP_LEVEL_FORMAT)) >>= xLevelFormats;
uno::Sequence< beans::PropertyValues > aLevel;
xLevelFormats->getByIndex( 1 ) >>= aLevel;
uno::Sequence< beans::PropertyValues > aNewLevel = lcl_createTOXLevelHyperlinks(
bHyperlinks, sChapterNoSeparator,
- aLevel, rPropNameSupplier );
+ aLevel );
xLevelFormats->replaceByIndex( 1, uno::makeAny( aNewLevel ) );
}
}
@@ -3396,7 +3379,6 @@ void DomainMapper_Impl::handleToc
void DomainMapper_Impl::handleBibliography
(FieldContextPtr pContext,
- PropertyNameSupplier& rPropNameSupplier,
const OUString & sTOCServiceName)
{
uno::Reference< beans::XPropertySet > xTOC;
@@ -3408,7 +3390,7 @@ void DomainMapper_Impl::handleBibliography
sTOCServiceName),
uno::UNO_QUERY_THROW);
if (xTOC.is())
- xTOC->setPropertyValue(rPropNameSupplier.GetName( PROP_TITLE ), uno::makeAny(OUString()));
+ xTOC->setPropertyValue(getPropertyName( PROP_TITLE ), uno::makeAny(OUString()));
pContext->SetTOC( xTOC );
m_bParaHadField = false;
@@ -3419,7 +3401,6 @@ void DomainMapper_Impl::handleBibliography
void DomainMapper_Impl::handleIndex
(FieldContextPtr pContext,
- PropertyNameSupplier& rPropNameSupplier,
uno::Reference< uno::XInterface > & /*xFieldInterface*/,
uno::Reference< beans::XPropertySet > const& /*xFieldProperties*/,
const OUString & sTOCServiceName)
@@ -3438,7 +3419,7 @@ void DomainMapper_Impl::handleIndex
uno::UNO_QUERY_THROW);
if (xTOC.is())
{
- xTOC->setPropertyValue(rPropNameSupplier.GetName( PROP_TITLE ), uno::makeAny(OUString()));
+ xTOC->setPropertyValue(getPropertyName( PROP_TITLE ), uno::makeAny(OUString()));
if( lcl_FindInCommand( pContext->GetCommand(), 'r', sValue ))
{
@@ -3452,7 +3433,7 @@ void DomainMapper_Impl::handleIndex
{
if(!sValue.isEmpty())
sIndexEntryType = sValue ;
- xTOC->setPropertyValue(rPropNameSupplier.GetName( PROP_INDEX_ENTRY_TYPE ), uno::makeAny(sIndexEntryType));
+ xTOC->setPropertyValue(getPropertyName( PROP_INDEX_ENTRY_TYPE ), uno::makeAny(sIndexEntryType));
}
}
pContext->SetTOC( xTOC );
@@ -3465,11 +3446,11 @@ void DomainMapper_Impl::handleIndex
{
sValue = sValue.replaceAll("\"", "");
uno::Reference<text::XTextColumns> xTextColumns;
- xTOC->getPropertyValue(rPropNameSupplier.GetName( PROP_TEXT_COLUMNS )) >>= xTextColumns;
+ xTOC->getPropertyValue(getPropertyName( PROP_TEXT_COLUMNS )) >>= xTextColumns;
if (xTextColumns.is())
{
xTextColumns->setColumnCount( sValue.toInt32() );
- xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_TEXT_COLUMNS ), uno::makeAny( xTextColumns ) );
+ xTOC->setPropertyValue( getPropertyName( PROP_TEXT_COLUMNS ), uno::makeAny( xTextColumns ) );
}
}
}
@@ -3578,23 +3559,22 @@ void DomainMapper_Impl::CloseFieldCommand()
xFieldProperties = uno::Reference< beans::XPropertySet >( xFieldInterface, uno::UNO_QUERY_THROW);
}
}
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
switch( aIt->second.eFieldId )
{
case FIELD_ADDRESSBLOCK: break;
case FIELD_ADVANCE : break;
case FIELD_ASK :
- handleFieldAsk(pContext, rPropNameSupplier, xFieldInterface, xFieldProperties);
+ handleFieldAsk(pContext, xFieldInterface, xFieldProperties);
break;
case FIELD_AUTONUM :
case FIELD_AUTONUMLGL :
case FIELD_AUTONUMOUT :
- handleAutoNum(pContext, rPropNameSupplier, xFieldInterface, xFieldProperties);
+ handleAutoNum(pContext, xFieldInterface, xFieldProperties);
break;
case FIELD_AUTHOR :
case FIELD_USERNAME :
case FIELD_USERINITIALS :
- handleAuthor(sFirstParam, rPropNameSupplier,
+ handleAuthor(sFirstParam,
xFieldInterface, xFieldProperties,
aIt->second.eFieldId);
break;
@@ -3605,17 +3585,17 @@ void DomainMapper_Impl::CloseFieldCommand()
if (pContext->IsFieldLocked())
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_IS_FIXED),
+ getPropertyName(PROP_IS_FIXED),
uno::makeAny( true ));
m_bSetDateValue = true;
}
else
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_IS_FIXED),
+ getPropertyName(PROP_IS_FIXED),
uno::makeAny( false ));
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_IS_DATE),
+ getPropertyName(PROP_IS_DATE),
uno::makeAny( true ));
SetNumberFormat( pContext->GetCommand(), xFieldProperties );
}
@@ -3632,19 +3612,19 @@ void DomainMapper_Impl::CloseFieldCommand()
// overwrite the Comments document property
// #TODO implement the above too
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName( PROP_IS_FIXED ), uno::makeAny( false ));
+ getPropertyName( PROP_IS_FIXED ), uno::makeAny( false ));
//PROP_CURRENT_PRESENTATION is set later anyway
}
break;
case FIELD_CREATEDATE :
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName( PROP_IS_DATE ), uno::makeAny( true ));
+ getPropertyName( PROP_IS_DATE ), uno::makeAny( true ));
SetNumberFormat( pContext->GetCommand(), xFieldProperties );
}
break;
case FIELD_DOCPROPERTY :
- handleDocProperty(pContext, sFirstParam, rPropNameSupplier,
+ handleDocProperty(pContext, sFirstParam,
xFieldInterface, xFieldProperties);
break;
case FIELD_DOCVARIABLE :
@@ -3672,7 +3652,7 @@ void DomainMapper_Impl::CloseFieldCommand()
xFieldProperties =
uno::Reference< beans::XPropertySet >( xFieldInterface,
uno::UNO_QUERY_THROW);
- xFieldProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_CONTENT), uno::makeAny(aResult.sResult));
+ xFieldProperties->setPropertyValue(getPropertyName(PROP_CONTENT), uno::makeAny(aResult.sResult));
}
else
{
@@ -3711,7 +3691,7 @@ void DomainMapper_Impl::CloseFieldCommand()
sal_Int32 nIndex = 0;
if (xFieldProperties.is())
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_HINT), uno::makeAny( pContext->GetCommand().getToken( 1, '\"', nIndex)));
+ getPropertyName(PROP_HINT), uno::makeAny( pContext->GetCommand().getToken( 1, '\"', nIndex)));
}
break;
case FIELD_FILENAME:
@@ -3719,7 +3699,7 @@ void DomainMapper_Impl::CloseFieldCommand()
sal_Int32 nNumberingTypeIndex = pContext->GetCommand().indexOf("\\p");
if (xFieldProperties.is())
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_FILE_FORMAT),
+ getPropertyName(PROP_FILE_FORMAT),
uno::makeAny( nNumberingTypeIndex > 0 ? text::FilenameDisplayFormat::FULL : text::FilenameDisplayFormat::NAME_AND_EXT ));
}
break;
@@ -3754,7 +3734,7 @@ void DomainMapper_Impl::CloseFieldCommand()
if ( aIt->second.eFieldId == FIELD_FORMDROPDOWN )
lcl_handleDropdownField( xFieldProperties, pContext->getFFDataHandler() );
else
- lcl_handleTextField( xFieldProperties, pContext->getFFDataHandler(), rPropNameSupplier );
+ lcl_handleTextField( xFieldProperties, pContext->getFFDataHandler() );
}
}
break;
@@ -3819,7 +3799,7 @@ void DomainMapper_Impl::CloseFieldCommand()
if (!sFirstParam.isEmpty())
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName( PROP_IS_FIXED ), uno::makeAny( true ));
+ getPropertyName( PROP_IS_FIXED ), uno::makeAny( true ));
//PROP_CURRENT_PRESENTATION is set later anyway
}
}
@@ -3832,13 +3812,13 @@ void DomainMapper_Impl::CloseFieldCommand()
OUString sMacro = pContext->GetCommand().getToken( 0, ' ', nIndex);
if (xFieldProperties.is())
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_MACRO_NAME), uno::makeAny( sMacro ));
+ getPropertyName(PROP_MACRO_NAME), uno::makeAny( sMacro ));
//extract quick help text
if(xFieldProperties.is() && pContext->GetCommand().getLength() > nIndex + 1)
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_HINT),
+ getPropertyName(PROP_HINT),
uno::makeAny( pContext->GetCommand().copy( nIndex )));
}
}
@@ -3865,10 +3845,10 @@ void DomainMapper_Impl::CloseFieldCommand()
if (xFieldProperties.is())
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_NUMBERING_TYPE),
+ getPropertyName(PROP_NUMBERING_TYPE),
uno::makeAny( lcl_ParseNumberingType(pContext->GetCommand()) ));
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_SUB_TYPE),
+ getPropertyName(PROP_SUB_TYPE),
uno::makeAny( text::PageNumberType_CURRENT ));
}
@@ -3888,10 +3868,10 @@ void DomainMapper_Impl::CloseFieldCommand()
+ sFirstParam))
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_REFERENCE_FIELD_SOURCE),
+ getPropertyName(PROP_REFERENCE_FIELD_SOURCE),
uno::makeAny( sal_Int16(text::ReferenceFieldSource::BOOKMARK)) );
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_SOURCE_NAME),
+ getPropertyName(PROP_SOURCE_NAME),
uno::makeAny(sFirstParam) );
sal_Int16 nFieldPart = (bPageRef ? text::ReferenceFieldPart::PAGE : text::ReferenceFieldPart::TEXT);
OUString sValue;
@@ -3916,16 +3896,16 @@ void DomainMapper_Impl::CloseFieldCommand()
nFieldPart = text::ReferenceFieldPart::NUMBER_FULL_CONTEXT;
}
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName( PROP_REFERENCE_FIELD_PART ), uno::makeAny( nFieldPart ));
+ getPropertyName( PROP_REFERENCE_FIELD_PART ), uno::makeAny( nFieldPart ));
}
else
{
xFieldInterface = m_xTextFactory->createInstance("com.sun.star.text.TextField.GetExpression");
xFieldProperties.set(xFieldInterface, uno::UNO_QUERY);
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_CONTENT),
+ getPropertyName(PROP_CONTENT),
uno::makeAny(sFirstParam));
- xFieldProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_SUB_TYPE), uno::makeAny(text::SetVariableType::STRING));
+ xFieldProperties->setPropertyValue(getPropertyName(PROP_SUB_TYPE), uno::makeAny(text::SetVariableType::STRING));
}
}
break;
@@ -3949,12 +3929,12 @@ void DomainMapper_Impl::CloseFieldCommand()
sSeqName);
xMaster->setPropertyValue(
- rPropNameSupplier.GetName(PROP_SUB_TYPE),
+ getPropertyName(PROP_SUB_TYPE),
uno::makeAny(text::SetVariableType::SEQUENCE));
// apply the numbering type
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_NUMBERING_TYPE),
+ getPropertyName(PROP_NUMBERING_TYPE),
uno::makeAny( lcl_ParseNumberingType(pContext->GetCommand()) ));
// attach the master to the field
@@ -3974,7 +3954,7 @@ void DomainMapper_Impl::CloseFieldCommand()
// TODO \s isn't handled, but the spec isn't easy to understand without
// an example for this one.
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_CONTENT),
+ getPropertyName(PROP_CONTENT),
uno::makeAny(sFormula));
// Take care of the numeric formatting definition, default is Arabic
@@ -3982,7 +3962,7 @@ void DomainMapper_Impl::CloseFieldCommand()
if (nNumberingType == style::NumberingType::PAGE_DESCRIPTOR)
nNumberingType = style::NumberingType::ARABIC;
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_NUMBERING_TYPE),
+ getPropertyName(PROP_NUMBERING_TYPE),
uno::makeAny(nNumberingType));
}
break;
@@ -3994,7 +3974,7 @@ void DomainMapper_Impl::CloseFieldCommand()
if (!sFirstParam.isEmpty())
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName( PROP_IS_FIXED ), uno::makeAny( true ));
+ getPropertyName( PROP_IS_FIXED ), uno::makeAny( true ));
//PROP_CURRENT_PRESENTATION is set later anyway
}
}
@@ -4006,7 +3986,7 @@ void DomainMapper_Impl::CloseFieldCommand()
if (pContext->IsFieldLocked())
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_IS_FIXED),
+ getPropertyName(PROP_IS_FIXED),
uno::makeAny( true ));
m_bSetDateValue = true;
}
@@ -4018,7 +3998,7 @@ void DomainMapper_Impl::CloseFieldCommand()
if (!sFirstParam.isEmpty())
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName( PROP_IS_FIXED ), uno::makeAny( true ));
+ getPropertyName( PROP_IS_FIXED ), uno::makeAny( true ));
//PROP_CURRENT_PRESENTATION is set later anyway
}
}
@@ -4026,15 +4006,15 @@ void DomainMapper_Impl::CloseFieldCommand()
case FIELD_USERADDRESS : //todo: user address collects street, city ...
break;
case FIELD_INDEX:
- handleIndex(pContext, rPropNameSupplier, xFieldInterface, xFieldProperties,
+ handleIndex(pContext, xFieldInterface, xFieldProperties,
OUString::createFromAscii(aIt->second.cFieldServiceName));
break;
case FIELD_BIBLIOGRAPHY:
- handleBibliography(pContext, rPropNameSupplier,
+ handleBibliography(pContext,
OUString::createFromAscii(aIt->second.cFieldServiceName));
break;
case FIELD_TOC:
- handleToc(pContext, rPropNameSupplier, xFieldInterface, xFieldProperties,
+ handleToc(pContext, xFieldInterface, xFieldProperties,
OUString::createFromAscii(aIt->second.cFieldServiceName));
break;
case FIELD_XE:
@@ -4095,7 +4075,7 @@ void DomainMapper_Impl::CloseFieldCommand()
uno::UNO_QUERY_THROW);
if (!sFirstParam.isEmpty())
{
- xTC->setPropertyValue(rPropNameSupplier.GetName(PROP_ALTERNATIVE_TEXT),
+ xTC->setPropertyValue(getPropertyName(PROP_ALTERNATIVE_TEXT),
uno::makeAny(sFirstParam));
}
OUString sValue;
@@ -4109,7 +4089,7 @@ void DomainMapper_Impl::CloseFieldCommand()
{
sal_Int32 nLevel = sValue.toInt32();
if( !sValue.isEmpty() && nLevel >= 0 && nLevel <= 10 )
- xTC->setPropertyValue(rPropNameSupplier.GetName(PROP_LEVEL), uno::makeAny( (sal_Int16)nLevel ));
+ xTC->setPropertyValue(getPropertyName(PROP_LEVEL), uno::makeAny( (sal_Int16)nLevel ));
}
// if( lcl_FindInCommand( pContext->GetCommand(), 'n', sValue ))
// \n Suppress page numbers
@@ -4124,7 +4104,7 @@ void DomainMapper_Impl::CloseFieldCommand()
case FIELD_NUMPAGES:
if (xFieldProperties.is())
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_NUMBERING_TYPE),
+ getPropertyName(PROP_NUMBERING_TYPE),
uno::makeAny( lcl_ParseNumberingType(pContext->GetCommand()) ));
break;
}
@@ -4230,7 +4210,6 @@ void DomainMapper_Impl::SetFieldResult(OUString const& rResult)
uno::Reference<text::XTextField> xTextField = pContext->GetTextField();
try
{
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
OSL_ENSURE( xTextField.is()
//||m_xTOC.is() ||m_xTC.is()
//||m_sHyperlinkURL.getLength()
@@ -4244,7 +4223,7 @@ void DomainMapper_Impl::SetFieldResult(OUString const& rResult)
// user field content has to be set at the field master
uno::Reference< text::XDependentTextField > xDependentField( xTextField, uno::UNO_QUERY_THROW );
xDependentField->getTextFieldMaster()->setPropertyValue(
- rPropNameSupplier.GetName(PROP_CONTENT),
+ getPropertyName(PROP_CONTENT),
uno::makeAny( rResult ));
}
else if ( m_bSetCitation )
@@ -4317,11 +4296,11 @@ void DomainMapper_Impl::SetFieldResult(OUString const& rResult)
if (bIsSetExpression)
{ // this will throw for field types without Content
uno::Any aValue(xFieldProperties->getPropertyValue(
- rPropNameSupplier.GetName(PROP_CONTENT)));
+ getPropertyName(PROP_CONTENT)));
aValue >>= sValue;
}
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(bIsSetExpression && sValue.isEmpty()? PROP_CONTENT : PROP_CURRENT_PRESENTATION),
+ getPropertyName(bIsSetExpression && sValue.isEmpty()? PROP_CONTENT : PROP_CURRENT_PRESENTATION),
uno::makeAny( rResult ));
}
}
@@ -4467,11 +4446,10 @@ void DomainMapper_Impl::PopFieldContext()
}
else if(!pContext->GetHyperlinkURL().isEmpty())
{
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
xCrsr->gotoEnd( true );
uno::Reference< beans::XPropertySet > xCrsrProperties( xCrsr, uno::UNO_QUERY_THROW );
- xCrsrProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_HYPER_LINK_U_R_L), uno::
+ xCrsrProperties->setPropertyValue(getPropertyName(PROP_HYPER_LINK_U_R_L), uno::
makeAny(pContext->GetHyperlinkURL()));
if (m_bStartTOC) {
@@ -4721,33 +4699,30 @@ void DomainMapper_Impl::SetLineNumbering( sal_Int32 nLnnMod, sal_uInt32 nLnc, sa
{
if( !m_bLineNumberingSet )
{
- const PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
-
try
{
uno::Reference< text::XLineNumberingProperties > xLineProperties( m_xTextDocument, uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xProperties = xLineProperties->getLineNumberingProperties();
uno::Any aTrue( uno::makeAny( true ));
- xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_IS_ON ), aTrue);
- xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_COUNT_EMPTY_LINES ), aTrue );
- xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_COUNT_LINES_IN_FRAMES ), uno::makeAny( false ) );
- xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_INTERVAL ), uno::makeAny( static_cast< sal_Int16 >( nLnnMod )));
- xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_DISTANCE ), uno::makeAny( ConversionHelper::convertTwipToMM100(ndxaLnn) ));
- xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_NUMBER_POSITION ), uno::makeAny( style::LineNumberPosition::LEFT));
- xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_NUMBERING_TYPE ), uno::makeAny( style::NumberingType::ARABIC));
- xProperties->setPropertyValue( rPropNameSupplier.GetName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny( nLnc == NS_ooxml::LN_Value_ST_LineNumberRestart_newPage ));
+ xProperties->setPropertyValue( getPropertyName( PROP_IS_ON ), aTrue);
+ xProperties->setPropertyValue( getPropertyName( PROP_COUNT_EMPTY_LINES ), aTrue );
+ xProperties->setPropertyValue( getPropertyName( PROP_COUNT_LINES_IN_FRAMES ), uno::makeAny( false ) );
+ xProperties->setPropertyValue( getPropertyName( PROP_INTERVAL ), uno::makeAny( static_cast< sal_Int16 >( nLnnMod )));
+ xProperties->setPropertyValue( getPropertyName( PROP_DISTANCE ), uno::makeAny( ConversionHelper::convertTwipToMM100(ndxaLnn) ));
+ xProperties->setPropertyValue( getPropertyName( PROP_NUMBER_POSITION ), uno::makeAny( style::LineNumberPosition::LEFT));
+ xProperties->setPropertyValue( getPropertyName( PROP_NUMBERING_TYPE ), uno::makeAny( style::NumberingType::ARABIC));
+ xProperties->setPropertyValue( getPropertyName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny( nLnc == NS_ooxml::LN_Value_ST_LineNumberRestart_newPage ));
}
catch( const uno::Exception& )
{}
}
m_bLineNumberingSet = true;
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
uno::Reference< style::XStyleFamiliesSupplier > xStylesSupplier( GetTextDocument(), uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xStyleFamilies = xStylesSupplier->getStyleFamilies();
uno::Reference<container::XNameContainer> xStyles;
- xStyleFamilies->getByName(rPropNameSupplier.GetName( PROP_PARAGRAPH_STYLES )) >>= xStyles;
- lcl_linenumberingHeaderFooter( rPropNameSupplier, xStyles, "Header", this );
- lcl_linenumberingHeaderFooter( rPropNameSupplier, xStyles, "Footer", this );
+ xStyleFamilies->getByName(getPropertyName( PROP_PARAGRAPH_STYLES )) >>= xStyles;
+ lcl_linenumberingHeaderFooter( xStyles, "Header", this );
+ lcl_linenumberingHeaderFooter( xStyles, "Footer", this );
}
@@ -4950,16 +4925,15 @@ void DomainMapper_Impl::ApplySettingsTable()
{
uno::Reference< beans::XPropertySet > xTextDefaults(m_xTextFactory->createInstance("com.sun.star.text.Defaults"), uno::UNO_QUERY_THROW );
sal_Int32 nDefTab = m_pSettingsTable->GetDefaultTabStop();
- xTextDefaults->setPropertyValue( PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_TAB_STOP_DISTANCE ), uno::makeAny(nDefTab) );
+ xTextDefaults->setPropertyValue( getPropertyName( PROP_TAB_STOP_DISTANCE ), uno::makeAny(nDefTab) );
if (m_pSettingsTable->GetLinkStyles())
{
- PropertyNameSupplier& rSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
// If linked styles are enabled, set paragraph defaults from Word's default template
- xTextDefaults->setPropertyValue(rSupplier.GetName(PROP_PARA_BOTTOM_MARGIN), uno::makeAny(ConversionHelper::convertTwipToMM100(200)));
+ xTextDefaults->setPropertyValue(getPropertyName(PROP_PARA_BOTTOM_MARGIN), uno::makeAny(ConversionHelper::convertTwipToMM100(200)));
style::LineSpacing aSpacing;
aSpacing.Mode = style::LineSpacingMode::PROP;
aSpacing.Height = sal_Int16(115);
- xTextDefaults->setPropertyValue(rSupplier.GetName(PROP_PARA_LINE_SPACING), uno::makeAny(aSpacing));
+ xTextDefaults->setPropertyValue(getPropertyName(PROP_PARA_LINE_SPACING), uno::makeAny(aSpacing));
}
if (m_pSettingsTable->GetZoomFactor())
@@ -4983,9 +4957,9 @@ void DomainMapper_Impl::ApplySettingsTable()
if (m_pSettingsTable->GetUsePrinterMetrics())
xSettings->setPropertyValue("PrinterIndependentLayout", uno::makeAny(document::PrinterIndependentLayout::DISABLED));
if( m_pSettingsTable->GetEmbedTrueTypeFonts())
- xSettings->setPropertyValue( PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_EMBED_FONTS ), uno::makeAny(true) );
+ xSettings->setPropertyValue( getPropertyName( PROP_EMBED_FONTS ), uno::makeAny(true) );
if( m_pSettingsTable->GetEmbedSystemFonts())
- xSettings->setPropertyValue( PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_EMBED_SYSTEM_FONTS ), uno::makeAny(true) );
+ xSettings->setPropertyValue( getPropertyName( PROP_EMBED_SYSTEM_FONTS ), uno::makeAny(true) );
xSettings->setPropertyValue("AddParaTableSpacing", uno::makeAny(m_pSettingsTable->GetDoNotUseHTMLParagraphAutoSpacing()));
}
catch(const uno::Exception&)
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index b2b24b4..05a0cc7 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -626,42 +626,35 @@ public:
void AppendFieldCommand(OUString& rPartOfCommand);
void handleFieldAsk
(FieldContextPtr pContext,
- PropertyNameSupplier& rPropNameSupplier,
css::uno::Reference< css::uno::XInterface > & xFieldInterface,
css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties);
void handleAutoNum
(FieldContextPtr pContext,
- PropertyNameSupplier& rPropNameSupplier,
css::uno::Reference< css::uno::XInterface > & xFieldInterface,
css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties);
static void handleAuthor
(OUString const& rFirstParam,
- PropertyNameSupplier& rPropNameSupplier,
css::uno::Reference< css::uno::XInterface > & xFieldInterface,
css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties,
FieldId eFieldId);
void handleDocProperty
(FieldContextPtr pContext,
OUString const& rFirstParam,
- PropertyNameSupplier& rPropNameSupplier,
css::uno::Reference< css::uno::XInterface > & xFieldInterface,
css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties);
void handleToc
(FieldContextPtr pContext,
- PropertyNameSupplier& rPropNameSupplier,
css::uno::Reference< css::uno::XInterface > & xFieldInterface,
css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties,
const OUString & sTOCServiceName);
void handleIndex
(FieldContextPtr pContext,
- PropertyNameSupplier& rPropNameSupplier,
css::uno::Reference< css::uno::XInterface > & xFieldInterface,
css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties,
const OUString & sTOCServiceName);
void handleBibliography
(FieldContextPtr pContext,
- PropertyNameSupplier& rPropNameSupplier,
const OUString & sTOCServiceName);
/// The field command has to be closed (cFieldSep appeared).
void CloseFieldCommand();
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx
index f44431c..7e21f0f2 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -271,15 +271,13 @@ sal_Int32 GraphicZOrderHelper::findZOrder( sal_Int32 relativeHeight, bool bOldSt
return 0;
sal_Int32 itemZOrder(0);
--it;
- if( it->second->getPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier()
- .GetName( PROP_Z_ORDER )) >>= itemZOrder )
+ if( it->second->getPropertyValue(getPropertyName( PROP_Z_ORDER )) >>= itemZOrder )
return itemZOrder + 1; // after the topmost
}
else
{
sal_Int32 itemZOrder(0);
- if( it->second->getPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier()
- .GetName( PROP_Z_ORDER )) >>= itemZOrder )
+ if( it->second->getPropertyValue(getPropertyName( PROP_Z_ORDER )) >>= itemZOrder )
return itemZOrder; // before the item
}
SAL_WARN( "writerfilter", "findZOrder() didn't find item z-order" );
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 1d9078d..4720f89 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -358,53 +358,48 @@ public:
void applyMargins(uno::Reference< beans::XPropertySet > xGraphicObjectProperties) const
{
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_LEFT_MARGIN ), uno::makeAny(nLeftMargin));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_RIGHT_MARGIN ), uno::makeAny(nRightMargin));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_TOP_MARGIN ), uno::makeAny(nTopMargin));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_BOTTOM_MARGIN ), uno::makeAny(nBottomMargin));
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_LEFT_MARGIN ), uno::makeAny(nLeftMargin));
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_RIGHT_MARGIN ), uno::makeAny(nRightMargin));
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_TOP_MARGIN ), uno::makeAny(nTopMargin));
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_BOTTOM_MARGIN ), uno::makeAny(nBottomMargin));
}
void applyPosition(uno::Reference< beans::XPropertySet > xGraphicObjectProperties) const
{
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_ORIENT ),
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_HORI_ORIENT ),
uno::makeAny(nHoriOrient));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT ),
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_VERT_ORIENT ),
uno::makeAny(nVertOrient));
}
void applyRelativePosition(uno::Reference< beans::XPropertySet > xGraphicObjectProperties, bool bRelativeOnly = false) const
{
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
if (!bRelativeOnly)
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_ORIENT_POSITION),
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_HORI_ORIENT_POSITION),
uno::makeAny(nLeftPosition));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_ORIENT_RELATION ),
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_HORI_ORIENT_RELATION ),
uno::makeAny(nHoriRelation));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_PAGE_TOGGLE ),
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_PAGE_TOGGLE ),
uno::makeAny(bPageToggle));
if (!bRelativeOnly)
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT_POSITION),
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_VERT_ORIENT_POSITION),
uno::makeAny(nTopPosition));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT_RELATION ),
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_VERT_ORIENT_RELATION ),
uno::makeAny(nVertRelation));
}
void applyZOrder(uno::Reference<beans::XPropertySet>& xGraphicObjectProperties) const
{
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
if (zOrder >= 0)
{
GraphicZOrderHelper* pZOrderHelper = rDomainMapper.graphicZOrderHelper();
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_Z_ORDER), uno::makeAny(pZOrderHelper->findZOrder(zOrder)));
+ xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_Z_ORDER), uno::makeAny(pZOrderHelper->findZOrder(zOrder)));
pZOrderHelper->addItem(xGraphicObjectProperties, zOrder);
}
}
void applyName(uno::Reference<beans::XPropertySet>& xGraphicObjectProperties) const
{
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
try
{
if( !sName.isEmpty() )
@@ -412,9 +407,9 @@ public:
uno::Reference< container::XNamed > xNamed( xGraphicObjectProperties, uno::UNO_QUERY_THROW );
xNamed->setName( sName );
}
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_DESCRIPTION ),
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_DESCRIPTION ),
uno::makeAny( sAlternativeText ));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_TITLE ),
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_TITLE ),
uno::makeAny( title ));
}
catch( const uno::Exception& e )
@@ -764,10 +759,8 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
(m_xShape, uno::UNO_QUERY_THROW);
- PropertyNameSupplier& rPropNameSupplier =
- PropertyNameSupplier::GetPropertyNameSupplier();
xShapeProps->setPropertyValue
- (rPropNameSupplier.GetName(PROP_ANCHOR_TYPE),
+ (getPropertyName(PROP_ANCHOR_TYPE),
uno::makeAny
(text::TextContentAnchorType_AS_CHARACTER));
@@ -785,7 +778,7 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
{
bKeepRotation = true;
xShapeProps->setPropertyValue
- (rPropNameSupplier.GetName(PROP_TEXT_RANGE),
+ (getPropertyName(PROP_TEXT_RANGE),
uno::makeAny
(m_pImpl->rDomainMapper.GetCurrentTextRange()));
}
@@ -1138,13 +1131,11 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
if(xGraphic.is())
{
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
-
uno::Reference< beans::XPropertySet > xGraphicObjectProperties(
m_xTextFactory->createInstance("com.sun.star.text.TextGraphicObject"),
uno::UNO_QUERY_THROW);
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_GRAPHIC), uno::makeAny( xGraphic ));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_ANCHOR_TYPE),
+ xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_GRAPHIC), uno::makeAny( xGraphic ));
+ xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_ANCHOR_TYPE),
uno::makeAny( m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR ?
text::TextContentAnchorType_AT_CHARACTER :
text::TextContentAnchorType_AS_CHARACTER ));
@@ -1177,7 +1168,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
};
for( sal_Int32 nBorder = 0; nBorder < 4; ++nBorder )
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( aBorderProps[nBorder]), uno::makeAny(aBorderLine));
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( aBorderProps[nBorder]), uno::makeAny(aBorderLine));
// setting graphic object shadow proerties
if (m_pImpl->bShadow)
@@ -1208,15 +1199,15 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
aShadow.Location = table::ShadowLocation_TOP_LEFT;
}
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_SHADOW_FORMAT), uno::makeAny(aShadow));
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list