summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-04 15:35:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-17 19:17:34 +0000
commitd87cb77b42b591b1333aacd60e107514d6e20864 (patch)
treef64b6efa30202b83c00e955048ff90cdf139bf2b /xmloff
parente95b076744da8911b2804501b418649a9147e3a9 (diff)
Resolves: fdo#68431 style:font-name unknown in non autostyles in impress/draw
Change-Id: Ib904af4fac5659821ba3b5dbbf62370df8243001 Reviewed-on: https://gerrit.libreoffice.org/5810 Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric@lanedo.com> Tested-by: Pierre-Eric Pelloux-Prayer <pierre-eric@lanedo.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/XMLChartPropertySetMapper.hxx1
-rw-r--r--xmloff/source/chart/PropertyMaps.cxx3
-rw-r--r--xmloff/source/draw/sdpropls.cxx6
-rw-r--r--xmloff/source/draw/sdpropls.hxx2
-rw-r--r--xmloff/source/style/PageMasterExportPropMapper.cxx3
-rw-r--r--xmloff/source/style/PageMasterExportPropMapper.hxx1
-rw-r--r--xmloff/source/style/styleexp.cxx2
-rw-r--r--xmloff/source/style/xmlexppr.cxx7
-rw-r--r--xmloff/source/text/txtexppr.cxx38
-rw-r--r--xmloff/source/text/txtexppr.hxx2
10 files changed, 42 insertions, 23 deletions
diff --git a/xmloff/inc/XMLChartPropertySetMapper.hxx b/xmloff/inc/XMLChartPropertySetMapper.hxx
index 5d353833a124..f2726baf09ed 100644
--- a/xmloff/inc/XMLChartPropertySetMapper.hxx
+++ b/xmloff/inc/XMLChartPropertySetMapper.hxx
@@ -58,6 +58,7 @@ private:
protected:
virtual void ContextFilter(
+ bool bEnableFoFontFamily,
::std::vector< XMLPropertyState >& rProperties,
::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > rPropSet ) const;
diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx
index f712aeb1ff9c..dc303f8abe7c 100644
--- a/xmloff/source/chart/PropertyMaps.cxx
+++ b/xmloff/source/chart/PropertyMaps.cxx
@@ -191,6 +191,7 @@ XMLChartExportPropertyMapper::~XMLChartExportPropertyMapper()
}
void XMLChartExportPropertyMapper::ContextFilter(
+ bool bEnableFoFontFamily,
std::vector< XMLPropertyState >& rProperties,
uno::Reference< beans::XPropertySet > rPropSet ) const
{
@@ -266,7 +267,7 @@ void XMLChartExportPropertyMapper::ContextFilter(
}
}
- SvXMLExportPropertyMapper::ContextFilter(rProperties, rPropSet);
+ SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
}
void XMLChartExportPropertyMapper::handleElementItem(
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 828b2c6561d6..d6fe22513f0b 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -1186,6 +1186,7 @@ XMLShapeExportPropertyMapper::~XMLShapeExportPropertyMapper()
}
void XMLShapeExportPropertyMapper::ContextFilter(
+ bool bEnableFoFontFamily,
std::vector< XMLPropertyState >& rProperties,
uno::Reference< beans::XPropertySet > rPropSet ) const
{
@@ -1506,7 +1507,7 @@ void XMLShapeExportPropertyMapper::ContextFilter(
if( pClipState != NULL && pClip11State != NULL )
pClip11State->mnIndex = -1;
- SvXMLExportPropertyMapper::ContextFilter(rProperties, rPropSet);
+ SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
}
void XMLShapeExportPropertyMapper::handleSpecialItem(
@@ -1567,6 +1568,7 @@ XMLPageExportPropertyMapper::~XMLPageExportPropertyMapper()
}
void XMLPageExportPropertyMapper::ContextFilter(
+ bool bEnableFoFontFamily,
std::vector< XMLPropertyState >& rProperties,
uno::Reference< beans::XPropertySet > rPropSet ) const
{
@@ -1711,7 +1713,7 @@ void XMLPageExportPropertyMapper::ContextFilter(
pTransType->mnIndex = -1;
}
- SvXMLExportPropertyMapper::ContextFilter(rProperties, rPropSet);
+ SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
}
void XMLPageExportPropertyMapper::handleElementItem(
diff --git a/xmloff/source/draw/sdpropls.hxx b/xmloff/source/draw/sdpropls.hxx
index 3f55a330d60c..eb1e9e91479c 100644
--- a/xmloff/source/draw/sdpropls.hxx
+++ b/xmloff/source/draw/sdpropls.hxx
@@ -239,6 +239,7 @@ private:
protected:
virtual void ContextFilter(
+ bool bEnableFoFontFamily,
::std::vector< XMLPropertyState >& rProperties,
::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > rPropSet ) const;
@@ -276,6 +277,7 @@ private:
protected:
virtual void ContextFilter(
+ bool bEnableFoFontFamily,
::std::vector< XMLPropertyState >& rProperties,
::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > rPropSet ) const;
diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx
index 0bf9d9ea4a65..b9da68a4783a 100644
--- a/xmloff/source/style/PageMasterExportPropMapper.cxx
+++ b/xmloff/source/style/PageMasterExportPropMapper.cxx
@@ -304,6 +304,7 @@ void XMLPageMasterExportPropMapper::handleSpecialItem(
}
void XMLPageMasterExportPropMapper::ContextFilter(
+ bool bEnableFoFontFamily,
::std::vector< XMLPropertyState >& rPropState,
Reference< XPropertySet > rPropSet ) const
{
@@ -452,7 +453,7 @@ void XMLPageMasterExportPropMapper::ContextFilter(
lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_ZEROVALUES), "PrintZeroValues", rPropSet);
}
- SvXMLExportPropertyMapper::ContextFilter(rPropState,rPropSet);
+ SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rPropState, rPropSet);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/style/PageMasterExportPropMapper.hxx b/xmloff/source/style/PageMasterExportPropMapper.hxx
index 2bd6dbbd022e..7e3c022c4d66 100644
--- a/xmloff/source/style/PageMasterExportPropMapper.hxx
+++ b/xmloff/source/style/PageMasterExportPropMapper.hxx
@@ -33,6 +33,7 @@ protected:
XMLFootnoteSeparatorExport aFootnoteSeparatorExport;
virtual void ContextFilter(
+ bool bEnableFoFontFamily,
::std::vector< XMLPropertyState >& rProperties,
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rPropSet
) const;
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 858d68a4c360..0d7ca9fbb3e9 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -318,7 +318,7 @@ sal_Bool XMLStyleExport::exportStyle(
// <style:properties>
::std::vector< XMLPropertyState > xPropStates =
- rPropMapper->Filter( xPropSet );
+ rPropMapper->Filter( xPropSet, true );
rPropMapper->exportXML( GetExport(), xPropStates,
XML_EXPORT_FLAG_IGN_WS );
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index df146bdc8405..6892e489fe27 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -582,7 +582,7 @@ void SvXMLExportPropertyMapper::ChainExportMapper(
vector< XMLPropertyState > SvXMLExportPropertyMapper::_Filter(
const Reference< XPropertySet > xPropSet,
- const sal_Bool bDefault ) const
+ bool bDefault, bool bEnableFoFontFamily) const
{
vector< XMLPropertyState > aPropStateArray;
@@ -675,7 +675,7 @@ vector< XMLPropertyState > SvXMLExportPropertyMapper::_Filter(
// Call centext-filter
if( !aPropStateArray.empty() )
- ContextFilter( aPropStateArray, xPropSet );
+ ContextFilter(bEnableFoFontFamily, aPropStateArray, xPropSet);
// Have to do if we change from a vector to a list or something like that
@@ -686,12 +686,13 @@ vector< XMLPropertyState > SvXMLExportPropertyMapper::_Filter(
}
void SvXMLExportPropertyMapper::ContextFilter(
+ bool bEnableFoFontFamily,
vector< XMLPropertyState >& rProperties,
Reference< XPropertySet > rPropSet ) const
{
// Derived class could implement this.
if (mpImpl->mxNextMapper.is())
- mpImpl->mxNextMapper->ContextFilter(rProperties, rPropSet);
+ mpImpl->mxNextMapper->ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
}
// Compares two Sequences of XMLPropertyState:
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index ec4e43929508..6c560cc2ac7f 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -190,6 +190,7 @@ XMLTextExportPropertySetMapper::~XMLTextExportPropertySetMapper()
}
void XMLTextExportPropertySetMapper::ContextFontFilter(
+ bool bEnableFoFontFamily,
XMLPropertyState *pFontNameState,
XMLPropertyState *pFontFamilyNameState,
XMLPropertyState *pFontStyleNameState,
@@ -241,19 +242,25 @@ void XMLTextExportPropertySetMapper::ContextFontFilter(
{
OUString sName( ((SvXMLExport&)GetExport()).GetFontAutoStylePool()->Find(
sFamilyName, sStyleName, nFamily, nPitch, eEnc ) );
- if( !sName.isEmpty() )
+ if (!sName.isEmpty())
{
pFontNameState->maValue <<= sName;
- if( pFontFamilyNameState )
- pFontFamilyNameState->mnIndex = -1;
- if( pFontStyleNameState )
- pFontStyleNameState->mnIndex = -1;
- if( pFontFamilyState )
- pFontFamilyState->mnIndex = -1;
- if( pFontPitchState )
- pFontPitchState->mnIndex = -1;
- if( pFontCharsetState )
- pFontCharsetState->mnIndex = -1;
+ //Resolves: fdo#68431 style:font-name unrecognized by LibreOffice
+ //<= 4.1 in styles (but recognized in autostyles) so add
+ //fo:font-family, etc
+ if (!bEnableFoFontFamily)
+ {
+ if( pFontFamilyNameState )
+ pFontFamilyNameState->mnIndex = -1;
+ if( pFontStyleNameState )
+ pFontStyleNameState->mnIndex = -1;
+ if( pFontFamilyState )
+ pFontFamilyState->mnIndex = -1;
+ if( pFontPitchState )
+ pFontPitchState->mnIndex = -1;
+ if( pFontCharsetState )
+ pFontCharsetState->mnIndex = -1;
+ }
}
else
{
@@ -479,6 +486,7 @@ static void lcl_FilterBorders(
}
void XMLTextExportPropertySetMapper::ContextFilter(
+ bool bEnableFoFontFamily,
::std::vector< XMLPropertyState >& rProperties,
Reference< XPropertySet > rPropSet ) const
{
@@ -781,15 +789,15 @@ void XMLTextExportPropertySetMapper::ContextFilter(
}
if( pFontNameState )
- ContextFontFilter( pFontNameState, pFontFamilyNameState,
+ ContextFontFilter( bEnableFoFontFamily, pFontNameState, pFontFamilyNameState,
pFontStyleNameState, pFontFamilyState,
pFontPitchState, pFontCharsetState );
if( pFontNameCJKState )
- ContextFontFilter( pFontNameCJKState, pFontFamilyNameCJKState,
+ ContextFontFilter( bEnableFoFontFamily, pFontNameCJKState, pFontFamilyNameCJKState,
pFontStyleNameCJKState, pFontFamilyCJKState,
pFontPitchCJKState, pFontCharsetCJKState );
if( pFontNameCTLState )
- ContextFontFilter( pFontNameCTLState, pFontFamilyNameCTLState,
+ ContextFontFilter( bEnableFoFontFamily, pFontNameCTLState, pFontFamilyNameCTLState,
pFontStyleNameCTLState, pFontFamilyCTLState,
pFontPitchCTLState, pFontCharsetCTLState );
@@ -1055,7 +1063,7 @@ void XMLTextExportPropertySetMapper::ContextFilter(
if( pClipState != NULL && pClip11State != NULL )
pClip11State->mnIndex = -1;
- SvXMLExportPropertyMapper::ContextFilter(rProperties,rPropSet);
+ SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
}
namespace {
diff --git a/xmloff/source/text/txtexppr.hxx b/xmloff/source/text/txtexppr.hxx
index 2736cd22b7f7..204141869564 100644
--- a/xmloff/source/text/txtexppr.hxx
+++ b/xmloff/source/text/txtexppr.hxx
@@ -35,6 +35,7 @@ class XMLTextExportPropertySetMapper: public SvXMLExportPropertyMapper
sal_Bool bDropWholeWord;
void ContextFontFilter(
+ bool bEnableFoFontFamily,
XMLPropertyState *pFontNameState,
XMLPropertyState *pFontFamilyNameState,
XMLPropertyState *pFontStyleNameState,
@@ -56,6 +57,7 @@ protected:
/** Application-specific filter. By default do nothing. */
virtual void ContextFilter(
+ bool bEnableFoFontFamily,
::std::vector< XMLPropertyState >& rProperties,
::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > rPropSet ) const;