summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorumeshkadam <umesh.kadam@synerzip.com>2014-04-21 19:46:00 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-04-27 18:14:53 +0000
commit825265f093a844f952d0dd64e5b4de9a1aba3185 (patch)
tree9f8dc4bfaefde62d5f75e057db8dccdb564e7b60 /sw/source
parentdfbaef22fcc66f86ecdfccb82037fbfd171c975d (diff)
fdo#77718: Picture inside SmartArt changes after RT
- The image data stream for the targets of relId's were getting overwritten, therefore the data was getting loss. - Added anchor id as part of computing a unique name for images. - Added UT for the same. Change-Id: I999ba1b3701ef357641dd0365403a5d7ad8d18aa Reviewed-on: https://gerrit.libreoffice.org/9121 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx10
-rw-r--r--sw/source/filter/ww8/docxsdrexport.hxx3
2 files changed, 8 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index da3c9e92769d..5c5d5a233dcb 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -807,7 +807,8 @@ void DocxSdrExport::writeDMLEffectLst(const SwFrmFmt& rFrmFmt)
void DocxSdrExport::writeDiagramRels(uno::Reference<xml::dom::XDocument> xDom,
uno::Sequence< uno::Sequence< uno::Any > > xRelSeq,
- uno::Reference< io::XOutputStream > xOutStream, const OUString& sGrabBagProperyName)
+ uno::Reference< io::XOutputStream > xOutStream, const OUString& sGrabBagProperyName,
+ int nAnchorId)
{
// add image relationships of OOXData, OOXDiagram
OUString sType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image");
@@ -838,7 +839,8 @@ void DocxSdrExport::writeDiagramRels(uno::Reference<xml::dom::XDocument> xDom,
uno::Reference<io::XInputStream> dataImagebin(new ::comphelper::SequenceInputStream(dataSeq));
OUString sFragment("../media/");
- sFragment += sGrabBagProperyName + OUString::number(j) + sExtension;
+ //nAnchorId is used to make the name unique irrespective of the number of smart arts.
+ sFragment += sGrabBagProperyName + OUString::number(nAnchorId) + "_" + OUString::number(j) + sExtension;
PropertySet aProps(xOutStream);
aProps.setAnyProperty(PROP_RelId, uno::makeAny(sal_Int32(sRelId.toInt32())));
@@ -1021,7 +1023,7 @@ void DocxSdrExport::writeDiagram(const SdrObject* sdrObject, const SwFrmFmt& rFr
uno::Sequence< beans::StringPair >());
// write the associated Images and rels for data file
- writeDiagramRels(dataDom, xDataRelSeq, xDataOutputStream, OUString("OOXDiagramDataRels"));
+ writeDiagramRels(dataDom, xDataRelSeq, xDataOutputStream, OUString("OOXDiagramDataRels"), nAnchorId);
// write layout file
serializer.set(layoutDom, uno::UNO_QUERY);
@@ -1058,7 +1060,7 @@ void DocxSdrExport::writeDiagram(const SdrObject* sdrObject, const SwFrmFmt& rFr
// write the associated Images and rels for drawing file
uno::Sequence< uno::Sequence< uno::Any > > xDrawingRelSeq;
diagramDrawing[1] >>= xDrawingRelSeq;
- writeDiagramRels(drawingDom, xDrawingRelSeq, xDrawingOutputStream, OUString("OOXDiagramDrawingRels"));
+ writeDiagramRels(drawingDom, xDrawingRelSeq, xDrawingOutputStream, OUString("OOXDiagramDrawingRels"), nAnchorId);
}
}
diff --git a/sw/source/filter/ww8/docxsdrexport.hxx b/sw/source/filter/ww8/docxsdrexport.hxx
index dced28cdcae6..32a5644701ef 100644
--- a/sw/source/filter/ww8/docxsdrexport.hxx
+++ b/sw/source/filter/ww8/docxsdrexport.hxx
@@ -87,7 +87,8 @@ public:
void writeDiagram(const SdrObject* sdrObject, const SwFrmFmt& rFrmFmt, int nAnchorId);
void writeDiagramRels(com::sun::star::uno::Reference< com::sun::star::xml::dom::XDocument> xDom,
com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< com::sun::star::uno::Any > > xRelSeq,
- com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xOutStream, const OUString& sGrabBagProperyName);
+ com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xOutStream, const OUString& sGrabBagProperyName,
+ int nAnchorId);
/// Writes text frame in DML format.
void writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId);
/// Writes text frame in VML format.