summaryrefslogtreecommitdiff
path: root/sw/source/filter/docx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-04-28 21:00:23 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2017-05-01 19:11:01 +0200
commit0d50845c4299a1b9564d65464fbf3997d598d6d1 (patch)
tree33621a70ffdb43aa4542266bf8b66717930c9379 /sw/source/filter/docx
parent680e72353350f6aeaeef0114830b4f941749ece3 (diff)
AutoText: Reading multiple entries
+ each entry is placed in a separate section + extended model and dmapper to react on docPart mark Change-Id: I7e5213a09ae7352d1d09369bd0a209b6d4e18e82 Reviewed-on: https://gerrit.libreoffice.org/37107 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw/source/filter/docx')
-rw-r--r--sw/source/filter/docx/swdocxreader.cxx25
1 files changed, 6 insertions, 19 deletions
diff --git a/sw/source/filter/docx/swdocxreader.cxx b/sw/source/filter/docx/swdocxreader.cxx
index 419d0bc142fb..7a3cc9425bd5 100644
--- a/sw/source/filter/docx/swdocxreader.cxx
+++ b/sw/source/filter/docx/swdocxreader.cxx
@@ -87,16 +87,8 @@ bool SwDOCXReader::ReadGlossaries( SwTextBlocks& rBlocks, bool /* bSaveRelFiles
aDescriptor[1].Name = "ReadGlossaries";
aDescriptor[1].Value <<= true;
- try
- {
- xFilter->filter( aDescriptor );
- }
- catch( uno::Exception const& e )
- {
- SAL_WARN("sw.docx", "SwDOCXReader::ReadGlossaries(): exception: " << e.Message);
- }
-
- return MakeEntries( static_cast<SwDocShell*>( &xDocSh )->GetDoc(), rBlocks );
+ if( xFilter->filter( aDescriptor ) )
+ return MakeEntries( static_cast<SwDocShell*>( &xDocSh )->GetDoc(), rBlocks );
}
return false;
@@ -110,7 +102,7 @@ bool SwDOCXReader::MakeEntries( SwDoc *pD, SwTextBlocks &rBlocks )
bool bRet = false;
SwNodeIndex aDocEnd( pD->GetNodes().GetEndOfContent() );
- SwNodeIndex aStart( *aDocEnd.GetNode().StartOfSectionNode() );
+ SwNodeIndex aStart( *aDocEnd.GetNode().StartOfSectionNode(), 1 );
if( aStart < aDocEnd && ( aDocEnd.GetIndex() - aStart.GetIndex() > 2 ) )
{
@@ -144,6 +136,7 @@ bool SwDOCXReader::MakeEntries( SwDoc *pD, SwTextBlocks &rBlocks )
}
aPam.GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
+ // Now we have the right selection for one entry
rBlocks.ClearDoc();
// TODO: correct entry name
@@ -174,15 +167,9 @@ bool SwDOCXReader::MakeEntries( SwDoc *pD, SwTextBlocks &rBlocks )
rBlocks.PutDoc();
}
- if( aStart.GetNodes().Count() <= aStart.GetNode().GetIndex() )
- aStart = aStart.GetNode().EndOfSectionIndex() + 1;
- else
- break;
-
+ aStart = aStart.GetNode().EndOfSectionIndex() + 1;
++nGlosEntry;
-
- } while( aStart < aDocEnd );
-
+ } while( aStart < aDocEnd && aStart.GetNode().IsStartNode() );
bRet = true;
}