summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorDaniel Sikeler <d.sikeler94@gmail.com>2014-10-30 14:53:48 +0000
committerMichael Stahl <mstahl@redhat.com>2014-11-05 11:50:42 +0000
commit4404b718bdb547cb9b7b17c73a53574724cdeeb7 (patch)
tree037ad212198f98bf7dc243cf5e86bebb58b4050f /sw/source
parentfc4d04d51b34cf81e0f69f7210071f795c81fee1 (diff)
fdo#79761: parse BlockList.xml only once
Change-Id: I3cfc5b66ee73b0e4d07a84c8255c5a006e4fbb25 Reviewed-on: https://gerrit.libreoffice.org/12210 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/sw3io/swacorr.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/sw/source/core/sw3io/swacorr.cxx b/sw/source/core/sw3io/swacorr.cxx
index 8472942872f0..0a08b012264b 100644
--- a/sw/source/core/sw3io/swacorr.cxx
+++ b/sw/source/core/sw3io/swacorr.cxx
@@ -37,20 +37,24 @@ TYPEINIT1( SwAutoCorrect, SvxAutoCorrect );
*
* @param rShort - the stream name (encrypted)
*/
-bool SwAutoCorrect::GetLongText( const uno::Reference < embed::XStorage >& rStg,
- const OUString& rShort, OUString& rLong )
+bool SwAutoCorrect::GetLongText( const OUString& rShort, OUString& rLong )
{
sal_uLong nRet = 0;
+ assert( m_pTextBlocks );
+ nRet = m_pTextBlocks->GetText( rShort, rLong );
+ return !IsError( nRet ) && !rLong.isEmpty();
+}
+
+void SwAutoCorrect::refreshBlockList( const uno::Reference< embed::XStorage >& rStg )
+{
if (rStg.is())
{
// mba: relative URLs don't make sense here
- SwXMLTextBlocks aBlk( rStg, OUString() );
- nRet = aBlk.GetText( rShort, rLong );
+ m_pTextBlocks.reset( new SwXMLTextBlocks( rStg, OUString() ) );
}
else {
- OSL_ENSURE( rStg.is(), "Someone passed SwAutoCorrect::GetLongText a dud storage!");
+ OSL_ENSURE( rStg.is(), "Someone passed SwAutoCorrect::refreshBlockList a dud storage!");
}
- return !IsError( nRet ) && !rLong.isEmpty();
}
// - Text mit Attributierung (kann nur der SWG - SWG-Format!)