summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package/source/xstor/owriteablestream.cxx10
-rw-r--r--package/source/xstor/owriteablestream.hxx3
-rw-r--r--package/source/xstor/xstorage.cxx4
-rw-r--r--package/source/zippackage/ZipPackage.cxx6
4 files changed, 16 insertions, 7 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index ba3d04f6a733..111eaa357d31 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -219,6 +219,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent,
, m_xOrigRelInfoStream( xRelInfoStream )
, m_bOrigRelInfoBroken( sal_False )
, m_nRelInfoStatus( RELINFO_NO_INIT )
+, m_nRelId( 1 )
{
OSL_ENSURE( xPackageStream.is(), "No package stream is provided!\n" );
OSL_ENSURE( xPackage.is(), "No package component is provided!\n" );
@@ -2548,9 +2549,9 @@ void SAL_CALL OWriteStream::insertRelationshipByID( const ::rtl::OUString& sID,
aSeq[nIDInd][0].First = aIDTag;
aSeq[nIDInd][0].Second = sID;
- sal_Int32 nIndTarget = 0;
+ sal_Int32 nIndTarget = 1;
for ( sal_Int32 nIndOrig = 0;
- nIndOrig <= aEntry.getLength();
+ nIndOrig < aEntry.getLength();
nIndOrig++ )
{
if ( !aEntry[nIndOrig].First.equals( aIDTag ) )
@@ -2818,6 +2819,11 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp )
if ( !m_pImpl )
throw lang::DisposedException();
+ if ( aProp.equalsAscii( "RelId" ) )
+ {
+ return uno::makeAny( m_pImpl->GetNewRelId() );
+ }
+
::rtl::OUString aPropertyName;
if ( aProp.equalsAscii( "IsEncrypted" ) )
aPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Encrypted" ) );
diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx
index 2dd7e4022e2e..e9b10ce8ebc0 100644
--- a/package/source/xstor/owriteablestream.hxx
+++ b/package/source/xstor/owriteablestream.hxx
@@ -139,6 +139,7 @@ struct OWriteStream_Impl : public PreCreationStruct
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aNewRelInfo;
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xNewRelInfoStream;
sal_Int16 m_nRelInfoStatus;
+ sal_Int32 m_nRelId;
private:
@@ -249,6 +250,8 @@ public:
const ::rtl::OUString& aNewStreamName );
void ReadRelInfoIfNecessary();
+
+ sal_Int32 GetNewRelId() { return m_nRelId ++; }
};
class OWriteStream : ::com::sun::star::lang::XTypeProvider
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 7857fa9439f6..755063f757d9 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -4717,9 +4717,9 @@ void SAL_CALL OStorage::insertRelationshipByID( const ::rtl::OUString& sID, con
aSeq[nIDInd][0].First = aIDTag;
aSeq[nIDInd][0].Second = sID;
- sal_Int32 nIndTarget = 0;
+ sal_Int32 nIndTarget = 1;
for ( sal_Int32 nIndOrig = 0;
- nIndOrig <= aEntry.getLength();
+ nIndOrig < aEntry.getLength();
nIndOrig++ )
{
if ( !aEntry[nIndOrig].First.equals( aIDTag ) )
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 531feb4420b8..2dd5e0a563d0 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1112,14 +1112,14 @@ sal_Bool ZipPackage::writeFileIsTemp()
{
::rtl::OUString aPath;
::rtl::OUString aType;
- OSL_ENSURE( (*aIter)[0].Name.equals( sMediaType ) && (*aIter)[1].Name.equals( sFullPath ),
+ OSL_ENSURE( (*aIter)[PKG_MNFST_MEDIATYPE].Name.equals( sMediaType ) && (*aIter)[PKG_MNFST_FULLPATH].Name.equals( sFullPath ),
"The mediatype sequence format is wrong!\n" );
- (*aIter)[0].Value >>= aType;
+ (*aIter)[PKG_MNFST_MEDIATYPE].Value >>= aType;
if ( aType.getLength() )
{
// only nonempty type makes sence here
nSeqLength++;
- (*aIter)[1].Value >>= aPath;
+ (*aIter)[PKG_MNFST_FULLPATH].Value >>= aPath;
aOverridesSequence[nSeqLength-1].First = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) + aPath;
aOverridesSequence[nSeqLength-1].Second = aType;
}