summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorerack <er@openoffice.org>2011-09-10 22:44:32 +0000
committerThorsten Behrens <tbehrens@suse.com>2011-11-23 23:34:56 +0100
commit6ad3c553a9bd3b8fb91c45204f0c833f52c52431 (patch)
tree8415a06dd1501fb32c7d4c24b6112dec63f25fd0 /filter
parent619ea0c6d3b8fb4390bf5e82f1b44608c3cd878d (diff)
impress212: #i97241# added relative links
* found as LGPLv3-only fix at svn rev 1167624 (http://svn.apache.org/viewvc?view=revision&revision=1167624)
Diffstat (limited to 'filter')
-rw-r--r--filter/inc/filter/msfilter/escherex.hxx16
-rw-r--r--filter/source/msfilter/escherex.cxx15
2 files changed, 26 insertions, 5 deletions
diff --git a/filter/inc/filter/msfilter/escherex.hxx b/filter/inc/filter/msfilter/escherex.hxx
index 5a0316758f04..94f700f2ae4c 100644
--- a/filter/inc/filter/msfilter/escherex.hxx
+++ b/filter/inc/filter/msfilter/escherex.hxx
@@ -42,6 +42,7 @@
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/drawing/BitmapMode.hpp>
#include <com/sun/star/drawing/Hatch.hpp>
#include <svx/msdffdef.hxx>
@@ -1086,6 +1087,8 @@ class MSFILTER_DLLPUBLIC EscherGraphicProvider
sal_uInt32 mnBlibBufSize;
sal_uInt32 mnBlibEntrys;
+ rtl::OUString maBaseURI;
+
protected:
sal_uInt32 ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry );
@@ -1109,6 +1112,9 @@ public:
sal_Bool GetPrefSize( const sal_uInt32 nBlibId, Size& rSize, MapMode& rMapMode );
+ void SetBaseURI( const rtl::OUString& rBaseURI ) { maBaseURI = rBaseURI; };
+ const rtl::OUString& GetBaseURI() { return maBaseURI; };
+
EscherGraphicProvider( sal_uInt32 nFlags = _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
~EscherGraphicProvider();
@@ -1551,12 +1557,12 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable
protected:
typedef ::std::auto_ptr< ImplEscherExSdr > ImplEscherExSdrPtr;
- EscherExGlobalRef mxGlobal;
- ImplEscherExSdrPtr mpImplEscherExSdr;
- SvStream* mpOutStrm;
+ EscherExGlobalRef mxGlobal;
+ ImplEscherExSdrPtr mpImplEscherExSdr;
+ SvStream* mpOutStrm;
sal_uInt32 mnStrmStartOfs;
- std::vector< sal_uInt32 > mOffsets;
- std::vector< sal_uInt16 > mRecTypes;
+ std::vector< sal_uInt32 > mOffsets;
+ std::vector< sal_uInt16 > mRecTypes;
sal_uInt32 mnCurrentDg;
sal_uInt32 mnCountOfs;
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 21e6f2d18737..71d4ac605979 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1411,6 +1411,21 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
delete pIn;
}
}
+ if ( !aUniqueId.Len() )
+ {
+ if ( pGraphicProvider )
+ {
+ const rtl::OUString& rBaseURI( pGraphicProvider->GetBaseURI() );
+ INetURLObject aBaseURI( rBaseURI );
+ if( aBaseURI.GetProtocol() == aTmp.GetProtocol() )
+ {
+ rtl::OUString aRelUrl( INetURLObject::GetRelURL( rBaseURI, aGraphicUrl,
+ INetURLObject::WAS_ENCODED, INetURLObject::DECODE_TO_IURI, RTL_TEXTENCODING_UTF8, INetURLObject::FSYS_DETECT ) );
+ if ( aRelUrl.getLength() )
+ aGraphicUrl = aRelUrl;
+ }
+ }
+ }
}
}