diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-18 16:18:20 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-18 16:18:20 +0100 |
commit | 15c98e06488d2d0e112525f8e7aff2eb3f21f39a (patch) | |
tree | 89d7a99b71ff451c1c1f12fb36d774266916225c | |
parent | 5a267de99f19bdab857429a81ffcfbb4d06f5bbd (diff) | |
parent | 2d5b4b02d6c9416ea6f23efd4be0c4202bca9843 (diff) |
Merge branch 'master' of git://anongit.freedesktop.org/libreoffice/writer
Conflicts:
sw/source/ui/dbui/mmoutputpage.cxx
-rw-r--r-- | sw/source/core/docnode/nodes.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmoutputpage.cxx | 31 |
2 files changed, 28 insertions, 21 deletions
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index ab3f5df151b1..b7ca7c0f5c77 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -1998,9 +1998,13 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, pDoc->GetNodes().GetEndOfInserts().StartOfSectionIndex() < aInsPos.GetIndex() ) { - nNodeCnt -= + ULONG nDistance = ( pAktNode->EndOfSectionIndex() - aRg.aStart.GetIndex() ); + if (nDistance < nNodeCnt) + nNodeCnt -= nDistance; + else + nNodeCnt = 1; // dann alle Nodes der Tabelle in die akt. Zelle kopieren // fuer den TabellenNode einen DummyNode einfuegen? @@ -2035,7 +2039,11 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, SwNodeIndex nStt( aInsPos, -1 ); SwTableNode* pTblNd = ((SwTableNode*)pAktNode)-> MakeCopy( pDoc, aInsPos ); - nNodeCnt -= aInsPos.GetIndex() - nStt.GetIndex() -2; + ULONG nDistance = aInsPos.GetIndex() - nStt.GetIndex() - 2; + if (nDistance < nNodeCnt) + nNodeCnt -= nDistance; + else + nNodeCnt = 1; aRg.aStart = pAktNode->EndOfSectionIndex(); @@ -2059,7 +2067,11 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, SwSectionNode* pSectNd = ((SwSectionNode*)pAktNode)-> MakeCopy( pDoc, aInsPos ); - nNodeCnt -= aInsPos.GetIndex() - nStt.GetIndex() -2; + ULONG nDistance = aInsPos.GetIndex() - nStt.GetIndex() - 2; + if (nDistance < nNodeCnt) + nNodeCnt -= nDistance; + else + nNodeCnt = 1; aRg.aStart = pAktNode->EndOfSectionIndex(); if( bNewFrms && pSectNd && diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index abb762d79a43..3953973c5cb1 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -1044,25 +1044,20 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) String sExtension = lcl_GetExtensionForDocType(nDocType); switch( nDocType ) { - case MM_DOCTYPE_OOO : break; - case MM_DOCTYPE_PDF : + case MM_DOCTYPE_OOO: { - //the method SwIOSystemGetFilterOfFormat( ) returns the template filter - //because it uses the same user data :-( - SfxFilterMatcher aMatcher( pFilterContainer->GetName() ); - SfxFilterMatcherIter aIter( &aMatcher ); - const SfxFilter* pFilter = aIter.First(); - String sFilterMime( String::CreateFromAscii( "application/pdf" )); - while ( pFilter ) - { - if( pFilter->GetMimeType() == sFilterMime && pFilter->CanExport() ) - { - pSfxFlt = pFilter; - break; - } - pFilter = aIter.Next(); - } - + //Make sure we don't pick e.g. the flat xml filter + //for this format + pSfxFlt = SwIoSystem::GetFilterOfFormat( + String::CreateFromAscii( FILTER_XML ), + SwDocShell::Factory().GetFilterContainer() ); + } + break; + case MM_DOCTYPE_PDF: + { + pSfxFlt = pFilterContainer->GetFilter4FilterName( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("writer_pdf_Export")), + SFX_FILTER_EXPORT); } break; case MM_DOCTYPE_WORD: |