summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-03-08 09:01:17 +0900
committerTomaž Vajngerl <quikee@gmail.com>2018-03-08 12:56:51 +0100
commitdfee7d93b4e863d673c45921f79bb876b5738ea6 (patch)
treed82ed3b540f740ef2aae3cb5f58692bf56a76a1e /sw
parent8f79f22a8d4b1c2d209c55cd618c24428960088f (diff)
sw: get rid of FN_UNO_GRAPHIC_U_R_L and "GraphicURL" property
Change-Id: I6148016658e5bb46fd4f8765a233a434174791fd Reviewed-on: https://gerrit.libreoffice.org/50922 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/cmdid.h2
-rw-r--r--sw/inc/unoprnms.hxx1
-rw-r--r--sw/qa/extras/globalfilter/globalfilter.cxx44
-rw-r--r--sw/qa/extras/htmlimport/htmlimport.cxx8
-rw-r--r--sw/qa/extras/rtfexport/rtfexport2.cxx6
-rw-r--r--sw/source/core/unocore/unoframe.cxx132
-rw-r--r--sw/source/core/unocore/unomap1.cxx1
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx10
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx18
9 files changed, 52 insertions, 170 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 2e048f6289a9..16de50113705 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -550,7 +550,7 @@
#define FN_UNO_IS_PIXEL_CONTOUR (FN_EXTRA2 + 83)
#define FN_UNO_ALTERNATIVE_TEXT (FN_EXTRA2 + 84)
#define FN_UNO_ACTUAL_SIZE (FN_EXTRA2 + 85)
-#define FN_UNO_GRAPHIC_U_R_L (FN_EXTRA2 + 86)
+// #define free (FN_EXTRA2 + 86)
#define FN_UNO_GRAPHIC_FILTER (FN_EXTRA2 + 87)
#define FN_UNO_CELL_NAME (FN_EXTRA2 + 88)
#define FN_INSERT_GLOSSARY (FN_EXTRA2 + 89)
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index b0d7f87d6bad..5c446e594c37 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -39,7 +39,6 @@
#define UNO_NAME_BACK_GRAPHIC "BackGraphic"
#define UNO_NAME_BACK_GRAPHIC_FILTER "BackGraphicFilter"
#define UNO_NAME_BACK_GRAPHIC_LOCATION "BackGraphicLocation"
-#define UNO_NAME_GRAPHIC_URL "GraphicURL"
#define UNO_NAME_GRAPHIC_FILTER "GraphicFilter"
#define UNO_NAME_GRAPHIC_SIZE "GraphicSize"
#define UNO_NAME_GRAPHIC_BITMAP "GraphicBitmap"
diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx
index 7c3082aec701..0c4d6612c53a 100644
--- a/sw/qa/extras/globalfilter/globalfilter.cxx
+++ b/sw/qa/extras/globalfilter/globalfilter.cxx
@@ -11,6 +11,7 @@
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/graphic/GraphicType.hpp>
#include <officecfg/Office/Common.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
@@ -105,16 +106,13 @@ void Test::testSwappedOutImageExport()
// First image
uno::Reference<drawing::XShape> xImage(xDraws->getByIndex(0), uno::UNO_QUERY);
uno::Reference< beans::XPropertySet > XPropSet( xImage, uno::UNO_QUERY_THROW );
- // Check URL
- {
- OUString sURL;
- XPropSet->getPropertyValue("GraphicURL") >>= sURL;
- CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), sURL != "vnd.sun.star.GraphicObject:00000000000000000000000000000000");
- }
- // Check size
+
+ // Check graphic, size
{
uno::Reference<graphic::XGraphic> xGraphic;
XPropSet->getPropertyValue("Graphic") >>= xGraphic;
+ CPPUNIT_ASSERT(xGraphic.is());
+ CPPUNIT_ASSERT(xGraphic->getType() != graphic::GraphicType::EMPTY);
uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY);
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), xBitmap.is());
CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), static_cast<sal_Int32>(610), xBitmap->getSize().Width );
@@ -124,17 +122,13 @@ void Test::testSwappedOutImageExport()
// Second Image
xImage.set(xDraws->getByIndex(1), uno::UNO_QUERY);
XPropSet.set( xImage, uno::UNO_QUERY_THROW );
- // Check URL
- {
- OUString sURL;
- XPropSet->getPropertyValue("GraphicURL") >>= sURL;
- CPPUNIT_ASSERT_MESSAGE(
- sFailedMessage.getStr(), sURL != "vnd.sun.star.GraphicObject:00000000000000000000000000000000");
- }
- // Check size
+
+ // Check graphic, size
{
uno::Reference<graphic::XGraphic> xGraphic;
XPropSet->getPropertyValue("Graphic") >>= xGraphic;
+ CPPUNIT_ASSERT(xGraphic.is());
+ CPPUNIT_ASSERT(xGraphic->getType() != graphic::GraphicType::EMPTY);
uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY);
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), xBitmap.is());
CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), static_cast<sal_Int32>(900), xBitmap->getSize().Width );
@@ -246,16 +240,13 @@ void Test::testImageWithSpecialID()
uno::Reference<drawing::XShape> xImage = getShape(1);
uno::Reference< beans::XPropertySet > XPropSet( xImage, uno::UNO_QUERY_THROW );
- // Check URL
- {
- OUString sURL;
- XPropSet->getPropertyValue("GraphicURL") >>= sURL;
- CPPUNIT_ASSERT(sURL != "vnd.sun.star.GraphicObject:00000000000000000000000000000000");
- }
- // Check size
+
+ // Check graphic, size
{
uno::Reference<graphic::XGraphic> xGraphic;
XPropSet->getPropertyValue("Graphic") >>= xGraphic;
+ CPPUNIT_ASSERT(xGraphic.is());
+ CPPUNIT_ASSERT(xGraphic->getType() != graphic::GraphicType::EMPTY);
uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY);
CPPUNIT_ASSERT(xBitmap.is());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(610), xBitmap->getSize().Width );
@@ -264,16 +255,13 @@ void Test::testImageWithSpecialID()
// Second Image
xImage = getShape(2);
XPropSet.set( xImage, uno::UNO_QUERY_THROW );
- // Check URL
- {
- OUString sURL;
- XPropSet->getPropertyValue("GraphicURL") >>= sURL;
- CPPUNIT_ASSERT(sURL != "vnd.sun.star.GraphicObject:00000000000000000000000000000000");
- }
+
// Check size
{
uno::Reference<graphic::XGraphic> xGraphic;
XPropSet->getPropertyValue("Graphic") >>= xGraphic;
+ CPPUNIT_ASSERT(xGraphic.is());
+ CPPUNIT_ASSERT(xGraphic->getType() != graphic::GraphicType::EMPTY);
uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY);
CPPUNIT_ASSERT(xBitmap.is());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(900), xBitmap->getSize().Width );
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx
index 079cc803b569..e01870143888 100644
--- a/sw/qa/extras/htmlimport/htmlimport.cxx
+++ b/sw/qa/extras/htmlimport/htmlimport.cxx
@@ -78,15 +78,11 @@ DECLARE_HTMLIMPORT_TEST(testInlinedImage, "inlined_image.html")
uno::Reference<container::XNamed> const xNamed(xShape, uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(OUString("Image1"), xNamed->getName());
- uno::Reference<graphic::XGraphic> xGraphic =
- getProperty< uno::Reference<graphic::XGraphic> >(xShape, "Graphic");
+ uno::Reference<graphic::XGraphic> xGraphic;
+ xGraphic = getProperty< uno::Reference<graphic::XGraphic> >(xShape, "Graphic");
CPPUNIT_ASSERT(xGraphic.is());
CPPUNIT_ASSERT(xGraphic->getType() != graphic::GraphicType::EMPTY);
- OUString sGraphicURL = getProperty< OUString >(xShape, "GraphicURL");
- // Before it was "data:image/png;base64,<data>"
- CPPUNIT_ASSERT(sGraphicURL.startsWith("vnd.sun.star.GraphicObject:"));
-
for (int n = 0; ; n++)
{
SwNode* pNode = pDoc->GetNodes()[ n ];
diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx
index 06b46172cbd2..5c7abf1068d5 100644
--- a/sw/qa/extras/rtfexport/rtfexport2.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport2.cxx
@@ -1873,8 +1873,10 @@ DECLARE_RTFEXPORT_TEST(testClassificatonPasteLevels, "classification-confidentia
DECLARE_RTFEXPORT_TEST(testTdf95707, "tdf95707.rtf")
{
// Graphic was replaced with a "Read-Error" placeholder.
- CPPUNIT_ASSERT(getProperty<OUString>(getShape(1), "GraphicURL")
- != "vnd.sun.star.GraphicObject:0000000000000000000000000000000000000000");
+ uno::Reference<graphic::XGraphic> xGraphic;
+ xGraphic = getProperty<uno::Reference<graphic::XGraphic>>(getShape(1), "Graphic");
+ CPPUNIT_ASSERT(xGraphic.is());
+ CPPUNIT_ASSERT(xGraphic->getType() != graphic::GraphicType::EMPTY);
}
DECLARE_RTFEXPORT_TEST(testTdf96275, "tdf96275.rtf")
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index bb2f794d7a3e..3a601806da34 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -151,9 +151,6 @@ using ::com::sun::star::frame::XModel;
using ::com::sun::star::container::XNameAccess;
using ::com::sun::star::style::XStyleFamiliesSupplier;
-const sal_Char sPackageProtocol[] = "vnd.sun.star.Package:";
-const sal_Char sGraphicObjectProtocol[] = "vnd.sun.star.GraphicObject:";
-
class BaseFrameProperties_Impl
{
SwUnoCursorHelper::SwAnyMapHelper aAnyMap;
@@ -1575,44 +1572,15 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
delete pSet;
}
- else if( FN_UNO_GRAPHIC_U_R_L == pEntry->nWID ||
- FN_UNO_GRAPHIC_FILTER == pEntry->nWID)
+ else if (FN_UNO_GRAPHIC_FILTER == pEntry->nWID)
{
OUString sGrfName;
OUString sFltName;
- std::unique_ptr<GraphicObject> pGrfObj;
SwDoc::GetGrfNms( *static_cast<SwFlyFrameFormat*>(pFormat), &sGrfName, &sFltName );
- OUString sTmp;
- aValue >>= sTmp;
+ aValue >>= sFltName;
UnoActionContext aAction(pFormat->GetDoc());
- if(FN_UNO_GRAPHIC_U_R_L == pEntry->nWID)
- {
- if( sTmp.startsWith(sPackageProtocol) )
- {
- pGrfObj = o3tl::make_unique<GraphicObject>();
- pGrfObj->SetUserData( sTmp );
- sGrfName.clear();
- }
- else if( sTmp.startsWith(sGraphicObjectProtocol) )
- {
- const OString sId(OUStringToOString(
- sTmp.copy(sizeof(sGraphicObjectProtocol)-1),
- RTL_TEXTENCODING_ASCII_US));
- pGrfObj = o3tl::make_unique<GraphicObject>( sId );
- sGrfName.clear();
- }
- else
- {
- sGrfName = sTmp;
- }
- }
- else
- {
- sFltName = sTmp;
- }
-
const ::SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
- if(pIdx)
+ if (pIdx)
{
SwNodeIndex aIdx(*pIdx, 1);
SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode();
@@ -1621,11 +1589,10 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
throw uno::RuntimeException();
}
SwPaM aGrfPaM(*pGrfNode);
- pFormat->GetDoc()->getIDocumentContentOperations().ReRead( aGrfPaM, sGrfName, sFltName, nullptr,
- pGrfObj.get() );
+ pFormat->GetDoc()->getIDocumentContentOperations().ReRead(aGrfPaM, sGrfName, sFltName, nullptr, nullptr);
}
}
- else if( FN_UNO_GRAPHIC == pEntry->nWID )
+ else if (FN_UNO_GRAPHIC == pEntry->nWID)
{
uno::Reference< graphic::XGraphic > xGraphic;
aValue >>= xGraphic;
@@ -1636,7 +1603,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
{
SwNodeIndex aIdx(*pIdx, 1);
SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode();
- if(!pGrfNode)
+ if (!pGrfNode)
{
throw uno::RuntimeException();
}
@@ -1652,7 +1619,6 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
aValue >>= xGraphic;
if (xGraphic.is())
{
- Graphic aGraphic(xGraphic);
const ::SwFormatContent* pCnt = &pFormat->GetContent();
if ( pCnt->GetContentIdx() && pDoc->GetNodes()[ pCnt->GetContentIdx()->GetIndex() + 1 ] )
{
@@ -1660,9 +1626,9 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
if ( pOleNode )
{
- svt::EmbeddedObjectRef &rObj = pOleNode->GetOLEObj().GetObject();
-
- rObj.SetGraphic( aGraphic, OUString() );
+ svt::EmbeddedObjectRef &rEmbeddedObject = pOleNode->GetOLEObj().GetObject();
+ Graphic aGraphic(xGraphic);
+ rEmbeddedObject.SetGraphic(aGraphic, OUString() );
}
}
}
@@ -2039,30 +2005,6 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
}
}
}
- else if( FN_UNO_GRAPHIC_U_R_L == pEntry->nWID)
- {
- OUString sGrfName;
- const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
- if(pIdx)
- {
- SwNodeIndex aIdx(*pIdx, 1);
- SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode();
- if(!pGrfNode)
- throw uno::RuntimeException();
- if( pGrfNode->IsGrfLink() )
- {
- SwDoc::GetGrfNms( *static_cast<SwFlyFrameFormat*>(pFormat), &sGrfName, nullptr );
- }
- else
- {
- OUString sId(OStringToOUString(
- pGrfNode->GetGrfObj().GetUniqueID(),
- RTL_TEXTENCODING_ASCII_US));
- sGrfName = sGraphicObjectProtocol + sId;
- }
- }
- aAny <<= sGrfName;
- }
else if (FN_UNO_REPLACEMENT_GRAPHIC == pEntry->nWID)
{
const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
@@ -2370,7 +2312,7 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
if(pEntry->nWID == FN_UNO_ANCHOR_TYPES||
pEntry->nWID == FN_PARAM_LINK_DISPLAY_NAME||
FN_UNO_FRAME_STYLE_NAME == pEntry->nWID||
- FN_UNO_GRAPHIC_U_R_L == pEntry->nWID||
+ FN_UNO_GRAPHIC == pEntry->nWID||
FN_UNO_GRAPHIC_FILTER == pEntry->nWID||
FN_UNO_ACTUAL_SIZE == pEntry->nWID||
FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID)
@@ -2777,53 +2719,27 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
}
else if( eType == FLYCNTTYPE_GRF)
{
- UnoActionContext aCont(pDoc);
- const ::uno::Any* pGraphicURL;
- OUString sGraphicURL;
- std::unique_ptr<GraphicObject> pGrfObj;
- if (m_pProps->GetProperty(FN_UNO_GRAPHIC_U_R_L, 0, pGraphicURL))
- {
- (*pGraphicURL) >>= sGraphicURL;
- if( sGraphicURL.startsWith(sPackageProtocol) )
- {
- pGrfObj = o3tl::make_unique<GraphicObject>();
- pGrfObj->SetUserData( sGraphicURL );
- sGraphicURL.clear();
- }
- else if( sGraphicURL.startsWith(sGraphicObjectProtocol) )
- {
- OString sId(OUStringToOString(
- sGraphicURL.copy( sizeof(sGraphicObjectProtocol)-1 ),
- RTL_TEXTENCODING_ASCII_US));
- pGrfObj = o3tl::make_unique<GraphicObject>( sId );
- sGraphicURL.clear();
- }
- }
+ UnoActionContext aActionContext(pDoc);
Graphic aGraphic;
- const ::uno::Any* pGraphic;
- const bool bHasGraphic = m_pProps->GetProperty(FN_UNO_GRAPHIC, 0, pGraphic);
- if( bHasGraphic )
+ const ::uno::Any* pGraphicAny;
+ const bool bHasGraphic = m_pProps->GetProperty(FN_UNO_GRAPHIC, 0, pGraphicAny);
+ if (bHasGraphic)
{
- uno::Reference< graphic::XGraphic > xGraphic;
- (*pGraphic) >>= xGraphic;
- aGraphic = Graphic( xGraphic );
+ uno::Reference<graphic::XGraphic> xGraphic;
+ (*pGraphicAny) >>= xGraphic;
+ aGraphic = Graphic(xGraphic);
}
- OUString sFltName;
- const ::uno::Any* pFilter;
- if (m_pProps->GetProperty(FN_UNO_GRAPHIC_FILTER, 0, pFilter))
+ OUString sFilterName;
+ const uno::Any* pFilterAny;
+ if (m_pProps->GetProperty(FN_UNO_GRAPHIC_FILTER, 0, pFilterAny))
{
- (*pFilter) >>= sFltName;
+ (*pFilterAny) >>= sFilterName;
}
- pFormat = pGrfObj
- ? pDoc->getIDocumentContentOperations().InsertGraphicObject(
- aPam, *pGrfObj.get(), &aFrameSet, &aGrSet, pParentFrameFormat)
- : pDoc->getIDocumentContentOperations().InsertGraphic(
- aPam, sGraphicURL, sFltName,
- (!bHasGraphic && !sGraphicURL.isEmpty()) ? nullptr : &aGraphic,
- &aFrameSet, &aGrSet, pParentFrameFormat);
- if(pFormat)
+ pFormat = pDoc->getIDocumentContentOperations().InsertGraphic(
+ aPam, OUString(), sFilterName, &aGraphic, &aFrameSet, &aGrSet, pParentFrameFormat);
+ if (pFormat)
{
SwGrfNode *pGrfNd = pDoc->GetNodes()[ pFormat->GetContent().GetContentIdx()
->GetIndex()+1 ]->GetGrfNode();
diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx
index fbe12b66844e..4b6a44211faa 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -849,7 +849,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetGraphicPropertyMap(
{ OUString(UNO_NAME_HORI_MIRRORED_ON_EVEN_PAGES), RES_GRFATR_MIRRORGRF, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_MIRROR_HORZ_EVEN_PAGES },
{ OUString(UNO_NAME_HORI_MIRRORED_ON_ODD_PAGES), RES_GRFATR_MIRRORGRF, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_MIRROR_HORZ_ODD_PAGES },
{ OUString(UNO_NAME_VERT_MIRRORED), RES_GRFATR_MIRRORGRF, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_MIRROR_VERT },
- { OUString(UNO_NAME_GRAPHIC_URL), FN_UNO_GRAPHIC_U_R_L, cppu::UnoType<OUString>::get(), 0, 0 },
{ OUString(UNO_NAME_REPLACEMENT_GRAPHIC), FN_UNO_REPLACEMENT_GRAPHIC, cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 },
{ OUString(UNO_NAME_GRAPHIC_FILTER), FN_UNO_GRAPHIC_FILTER, cppu::UnoType<OUString>::get(), 0, 0 },
{ OUString(UNO_NAME_GRAPHIC), FN_UNO_GRAPHIC, cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 },
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 6c069de73777..3e4c9396f99b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4482,14 +4482,14 @@ void DocxAttributeOutput::WriteSrcRect(const SdrObject* pSdrObj, const SwFrameFo
uno::Reference< drawing::XShape > xShape( const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY );
uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY );
- OUString sUrl;
- xPropSet->getPropertyValue("GraphicURL") >>= sUrl;
- const GraphicObject aGrafObj(GraphicObject::CreateGraphicObjectFromURL(sUrl));
+ uno::Reference<graphic::XGraphic> xGraphic;
+ xPropSet->getPropertyValue("Graphic") >>= xGraphic;
+ const Graphic aGraphic(xGraphic);
- Size aOriginalSize(aGrafObj.GetPrefSize());
+ Size aOriginalSize(aGraphic.GetPrefSize());
const MapMode aMap100mm( MapUnit::Map100thMM );
- const MapMode& rMapMode = aGrafObj.GetPrefMapMode();
+ const MapMode& rMapMode = aGraphic.GetPrefMapMode();
if (rMapMode.GetMapUnit() == MapUnit::MapPixel)
{
aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, aMap100mm);
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index b62dd2b7c16b..42767872be02 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -517,24 +517,6 @@ void RtfSdrExport::impl_writeGraphic()
{
aGraphic = Graphic(xGraphic);
}
- else
- {
- OUString sGraphicURL;
- try
- {
- xPropertySet->getPropertyValue("GraphicURL") >>= sGraphicURL;
- }
- catch (beans::UnknownPropertyException& rException)
- {
- // ATM groupshapes are not supported, just make sure we don't crash on them.
- SAL_WARN("sw.rtf", "failed. Message: " << rException);
- return;
- }
-
- OString aURLBS(OUStringToOString(sGraphicURL, RTL_TEXTENCODING_UTF8));
- OString aUrl = aURLBS.copy(RTL_CONSTASCII_LENGTH("vnd.sun.star.GraphicObject:"));
- aGraphic = GraphicObject(aUrl).GetTransformedGraphic();
- }
// Export it to a stream.
SvMemoryStream aStream;