summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-08-28 19:15:25 +0200
committerAndras Timar <andras.timar@collabora.com>2017-09-01 13:08:01 +0200
commit0b7da4106adb9f760c96acdfb522538213aac479 (patch)
tree8b1286c58ff602dc297b0d8b8efab0e991a04ffb /filter
parent21a6cb83a421aa80fbb90040742bac66ef00edb5 (diff)
Follow up changes related to DOCX form control export
These lines are expected to be called only for DOCX format. AnchorType is a Writer specific attribute so it can be used to decide on the file format. Change-Id: Ie92f1ff801fac09cb9f658e523244ffc928690f2 Reviewed-on: https://gerrit.libreoffice.org/41655 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit dada5958c1a5565e9d7e098c75c90f60e575ab62) Reviewed-on: https://gerrit.libreoffice.org/41661 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/eschesdo.cxx30
1 files changed, 14 insertions, 16 deletions
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index d7be855f911b..53a8daf6131c 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -424,28 +424,26 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
}
else if ( rObj.GetType() == "drawing.Control" )
{
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- bool bInline = false;
const Reference< XPropertySet > xPropSet(rObj.mXPropSet, UNO_QUERY);
- if(xPropSet.is())
+ const Reference<XPropertySetInfo> xPropInfo = xPropSet.is() ? xPropSet->getPropertySetInfo() : Reference<XPropertySetInfo>();
+ // This code is expected to be called only for DOCX format.
+ if (xPropInfo.is() && xPropInfo->hasPropertyByName("AnchorType") && bOOxmlExport)
{
- const Reference<XPropertySetInfo> xPropInfo = xPropSet->getPropertySetInfo();
- if (xPropInfo.is() && xPropInfo->hasPropertyByName("AnchorType"))
+ text::TextContentAnchorType eAnchorType;
+ xPropSet->getPropertyValue("AnchorType") >>= eAnchorType;
+ bool bInline = eAnchorType == text::TextContentAnchorType_AS_CHARACTER;
+ mpEscherEx->OpenContainer( ESCHER_SpContainer );
+ if(bInline)
{
- text::TextContentAnchorType eAnchorType;
- xPropSet->getPropertyValue("AnchorType") >>= eAnchorType;
- bInline = eAnchorType == text::TextContentAnchorType_AS_CHARACTER;
+ ADD_SHAPE( ESCHER_ShpInst_PictureFrame, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR );
+ }
+ else
+ {
+ ADD_SHAPE( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR );
}
- }
-
- if(bInline)
- {
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR );
}
else
- {
- ADD_SHAPE( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR );
- }
+ break;
}
else if ( rObj.GetType() == "drawing.Connector" )
{