include/xmloff/txtparae.hxx | 1 sw/inc/cmdid.h | 4 +- sw/inc/unoprnms.hxx | 1 sw/qa/extras/odfexport/odfexport.cxx | 5 +- sw/source/core/unocore/unoframe.cxx | 61 ++--------------------------------- sw/source/core/unocore/unomap1.cxx | 2 - 6 files changed, 10 insertions(+), 64 deletions(-)
New commits: commit f0a14acc4ebe7f1192b195738540cd9f4e1435fa Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> Date: Wed Feb 21 17:26:08 2018 +0900 sw: remove "ReplacementGraphicURL" related things Change-Id: Ia6892e3cd84b2466ea30828e9b18310789dc1686 Reviewed-on: https://gerrit.libreoffice.org/50138 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index b9b8db588d93..35c163014a62 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -150,7 +150,6 @@ private: const OUString sGraphicFilter; const OUString sGraphicRotation; const OUString sGraphicURL; - const OUString sReplacementGraphicURL; const OUString sHeight; const OUString sHoriOrient; const OUString sHoriOrientPosition; diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 99b25ec056a8..2e048f6289a9 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -568,7 +568,7 @@ #define FN_UNO_PARA_STYLE_CONDITIONS (FN_EXTRA2 + 100) #define FN_UNO_GRAPHIC (FN_EXTRA2 + 101) -#define FN_UNO_REPLACEMENT_GRAPHIC_URL (FN_EXTRA2 + 102) +// #define free (FN_EXTRA2 + 102) #define FN_UNO_CELL_ROW_SPAN (FN_EXTRA2 + 103) #define FN_UNO_TABLE_BORDER_DISTANCES (FN_EXTRA2 + 104) #define FN_SPELL_GRAMMAR_DIALOG (FN_EXTRA2 + 105) @@ -596,7 +596,7 @@ #define FN_UNO_FOOTER_FIRST (FN_EXTRA2 + 119) #define FN_UNO_TABLE_BORDER2 (FN_EXTRA2 + 120) -#define FN_UNO_REPLACEMENT_GRAPHIC_U_R_L (FN_EXTRA2 + 121) +// #define free (FN_EXTRA2 + 121) #define FN_UNO_HIDDEN (FN_EXTRA2 + 122) #define FN_UNO_STYLE_INTEROP_GRAB_BAG (FN_EXTRA2 + 123) #define FN_UNO_TABLE_TEMPLATE_NAME (FN_EXTRA2 + 124) diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index e5e1f31d2464..b603a7a6be8c 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -828,7 +828,6 @@ #define UNO_NAME_FOOTER_TEXT_FIRST "FooterTextFirst" #define UNO_NAME_INITIALS "Initials" #define UNO_NAME_TABLE_BORDER2 "TableBorder2" -#define UNO_NAME_REPLACEMENT_GRAPHIC_URL "ReplacementGraphicURL" #define UNO_NAME_REPLACEMENT_GRAPHIC "ReplacementGraphic" #define UNO_NAME_HIDDEN "Hidden" #define UNO_NAME_DEFAULT_PAGE_MODE "DefaultPageMode" diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index c0ca863162c4..a602011ec992 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -1434,9 +1434,10 @@ DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt") { uno::Reference<drawing::XShape> xShape = getShape(1); // This failed, pdf+png replacement graphics pair didn't survive an ODT roundtrip. - CPPUNIT_ASSERT(!getProperty<OUString>(xShape, "ReplacementGraphicURL").isEmpty()); + auto xReplacementGraphic = getProperty<uno::Reference<graphic::XGraphic>>(xShape, "ReplacementGraphic"); + CPPUNIT_ASSERT(xReplacementGraphic.is()); - auto xGraphic = getProperty< uno::Reference<graphic::XGraphic> >(xShape, "Graphic"); + auto xGraphic = getProperty<uno::Reference<graphic::XGraphic>>(xShape, "Graphic"); CPPUNIT_ASSERT(xGraphic.is()); // This was image/x-vclgraphic, not exposing the info that the image is a PDF one. CPPUNIT_ASSERT_EQUAL(OUString("application/pdf"), getProperty<OUString>(xGraphic, "MimeType")); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 8b3595b40af0..cb59f4ddae79 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1639,41 +1639,13 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& } } } - else if( FN_UNO_REPLACEMENT_GRAPHIC_URL == pEntry->nWID || FN_UNO_REPLACEMENT_GRAPHIC == pEntry->nWID ) + else if (FN_UNO_REPLACEMENT_GRAPHIC == pEntry->nWID) { - bool bURL = FN_UNO_REPLACEMENT_GRAPHIC_URL == pEntry->nWID; - bool bApply = false; - Graphic aGraphic; - if( bURL ) - { - OUString aGrfUrl; - aValue >>= aGrfUrl; - - // the package URL based graphics are handled in different way currently - // TODO/LATER: actually this is the correct place to handle them - OUString aGraphicProtocol( sGraphicObjectProtocol ); - if( aGrfUrl.startsWith( aGraphicProtocol ) ) - { - OString sId(OUStringToOString( - aGrfUrl.copy(sizeof(sGraphicObjectProtocol)-1), - RTL_TEXTENCODING_ASCII_US)); - aGraphic = GraphicObject( sId ).GetGraphic(); - bApply = true; - } - } - else - { - uno::Reference< graphic::XGraphic > xGraphic; - aValue >>= xGraphic; - if( xGraphic.is() ) - { - aGraphic = Graphic( xGraphic ); - bApply = true; - } - } - - if ( bApply ) + uno::Reference<graphic::XGraphic> xGraphic; + aValue >>= xGraphic; + if (xGraphic.is()) { + Graphic aGraphic(xGraphic); const ::SwFormatContent* pCnt = &pFormat->GetContent(); if ( pCnt->GetContentIdx() && pDoc->GetNodes()[ pCnt->GetContentIdx()->GetIndex() + 1 ] ) { @@ -2084,29 +2056,6 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) } aAny <<= sGrfName; } - else if( FN_UNO_REPLACEMENT_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(); - - const GraphicObject* pGraphicObject = pGrfNode->GetReplacementGrfObj(); - - if(pGraphicObject) - { - sGrfName = sGraphicObjectProtocol - + OStringToOUString( pGraphicObject->GetUniqueID(), RTL_TEXTENCODING_ASCII_US ); - } - } - - aAny <<= sGrfName; - } else if (FN_UNO_REPLACEMENT_GRAPHIC == pEntry->nWID) { const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx(); diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx index 7074c5b2b0f6..12ea1a23e08d 100644 --- a/sw/source/core/unocore/unomap1.cxx +++ b/sw/source/core/unocore/unomap1.cxx @@ -847,7 +847,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetGraphicPropertyMap( { 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_URL), FN_UNO_REPLACEMENT_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 }, @@ -894,7 +893,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetEmbeddedPropertyMap { OUString(UNO_NAME_CLSID), FN_UNO_CLSID, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0 }, { OUString(UNO_NAME_STREAM_NAME), FN_UNO_STREAM_NAME, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0 }, { OUString(UNO_NAME_MODEL), FN_UNO_MODEL, cppu::UnoType<css::frame::XModel>::get(), PropertyAttribute::READONLY|PropertyAttribute::MAYBEVOID, 0}, - { OUString(UNO_NAME_GRAPHIC_URL), FN_UNO_REPLACEMENT_GRAPHIC_URL, cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID, 0 }, { OUString(UNO_NAME_GRAPHIC), FN_UNO_REPLACEMENT_GRAPHIC, cppu::UnoType<css::graphic::XGraphic>::get(), PropertyAttribute::MAYBEVOID, 0 }, { OUString(UNO_NAME_COMPONENT),FN_UNO_COMPONENT, cppu::UnoType<css::lang::XComponent>::get(), PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_EMBEDDED_OBJECT),FN_EMBEDDED_OBJECT, cppu::UnoType<css::embed::XEmbeddedObject>::get(), PROPERTY_NONE, 0}, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits