LibreOffice Module sw (master)  1
SwXMLTextBlocks1.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <com/sun/star/embed/ElementModes.hpp>
21 #include <com/sun/star/embed/XTransactedObject.hpp>
22 #include <osl/diagnose.h>
23 #include <svl/macitem.hxx>
24 #include <svtools/unoevent.hxx>
25 #include <sfx2/docfile.hxx>
26 #include <unotools/streamwrap.hxx>
27 #include <comphelper/fileformat.h>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <com/sun/star/xml/sax/InputSource.hpp>
31 #include <com/sun/star/io/IOException.hpp>
32 #include <com/sun/star/io/XActiveDataSource.hpp>
33 #include <com/sun/star/xml/sax/Parser.hpp>
34 #include <com/sun/star/xml/sax/FastParser.hpp>
35 #include <com/sun/star/xml/sax/FastToken.hpp>
36 #include <com/sun/star/xml/sax/Writer.hpp>
37 #include <com/sun/star/xml/sax/SAXParseException.hpp>
38 #include <com/sun/star/document/XStorageBasedDocument.hpp>
39 #include <doc.hxx>
40 #include <docsh.hxx>
41 #include <shellio.hxx>
42 #include <SwXMLTextBlocks.hxx>
43 #include <SwXMLBlockImport.hxx>
44 #include <SwXMLBlockExport.hxx>
45 #include <xmloff/xmlnmspe.hxx>
46 #include <sfx2/event.hxx>
47 #include <swevent.hxx>
48 #include <swerror.h>
49 
50 const char XMLN_BLOCKLIST[] = "BlockList.xml";
51 
52 using namespace ::com::sun::star;
53 using namespace ::com::sun::star::uno;
54 using namespace ::com::sun::star::container;
55 using namespace css::xml::sax;
56 using namespace xmloff::token;
57 
58 using ::xmloff::token::XML_BLOCK_LIST;
59 using ::xmloff::token::XML_UNFORMATTED_TEXT;
60 using ::xmloff::token::GetXMLToken;
61 
62 ErrCode SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx )
63 {
64  OUString aFolderName ( GetPackageName ( nIdx ) );
65 
66  if (!IsOnlyTextBlock ( nIdx ) )
67  {
68  try
69  {
70  xRoot = xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ );
71  xMedium = new SfxMedium( xRoot, GetBaseURL(), "writer8" );
72  SwReader aReader( *xMedium, aFolderName, m_xDoc.get() );
73  ReadXML->SetBlockMode( true );
74  aReader.Read( *ReadXML );
75  ReadXML->SetBlockMode( false );
76  // Ole objects fail to display when inserted into the document, as
77  // the ObjectReplacement folder and contents are missing
78  OUString sObjReplacements( "ObjectReplacements" );
79  if ( xRoot->hasByName( sObjReplacements ) )
80  {
81  uno::Reference< document::XStorageBasedDocument > xDocStor( m_xDoc->GetDocShell()->GetModel(), uno::UNO_QUERY_THROW );
82  uno::Reference< embed::XStorage > xStr( xDocStor->getDocumentStorage() );
83  if ( xStr.is() )
84  {
85  xRoot->copyElementTo( sObjReplacements, xStr, sObjReplacements );
86  uno::Reference< embed::XTransactedObject > xTrans( xStr, uno::UNO_QUERY );
87  if ( xTrans.is() )
88  xTrans->commit();
89  }
90  }
91  }
92  catch( uno::Exception& )
93  {
94  }
95 
96  xRoot = nullptr;
97  }
98  else
99  {
100  OUString aStreamName = aFolderName + ".xml";
101  try
102  {
103  xRoot = xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ );
104  uno::Reference < io::XStream > xStream = xRoot->openStreamElement( aStreamName, embed::ElementModes::READ );
105 
106  uno::Reference< uno::XComponentContext > xContext =
108 
109  xml::sax::InputSource aParserInput;
110  aParserInput.sSystemId = m_aNames[nIdx]->aPackageName;
111 
112  aParserInput.aInputStream = xStream->getInputStream();
113 
114  // get filter
115  uno::Reference< xml::sax::XFastDocumentHandler > xFilter = new SwXMLTextBlockImport( xContext, m_aCurrentText, true );
116  uno::Reference< xml::sax::XFastTokenHandler > xTokenHandler = new SwXMLTextBlockTokenHandler();
117 
118  // connect parser and filter
119  uno::Reference< xml::sax::XFastParser > xParser = xml::sax::FastParser::create(xContext);
120  xParser->setFastDocumentHandler( xFilter );
121  xParser->setTokenHandler( xTokenHandler );
122 
123  xParser->registerNamespace( "http://openoffice.org/2000/text", FastToken::NAMESPACE | XML_NAMESPACE_TEXT );
124  xParser->registerNamespace( "http://openoffice.org/2000/office", FastToken::NAMESPACE | XML_NAMESPACE_OFFICE );
125 
126  // parse
127  try
128  {
129  xParser->parseStream( aParserInput );
130  }
131  catch( xml::sax::SAXParseException& )
132  {
133  // re throw ?
134  }
135  catch( xml::sax::SAXException& )
136  {
137  // re throw ?
138  }
139  catch( io::IOException& )
140  {
141  // re throw ?
142  }
143 
144  m_bInfoChanged = false;
145  MakeBlockText(m_aCurrentText);
146  }
147  catch( uno::Exception& )
148  {
149  }
150 
151  xRoot = nullptr;
152  }
153  return ERRCODE_NONE;
154 }
155 
156 // event description for autotext events; this constant should really be
157 // taken from unocore/unoevents.cxx or ui/unotxt.cxx
159 {
160  { SvMacroItemId::SwStartInsGlossary, "OnInsertStart" },
161  { SvMacroItemId::SwEndInsGlossary, "OnInsertDone" },
162  { SvMacroItemId::NONE, nullptr }
163 };
164 
166  SvxMacroTableDtor& rMacroTable )
167 {
168  // set current auto text
169  m_aShort = m_aNames[nIdx]->aShort;
170  m_aLong = m_aNames[nIdx]->aLong;
171  aPackageName = m_aNames[nIdx]->aPackageName;
172 
173  ErrCode nRet = ERRCODE_NONE;
174 
175  // open stream in proper sub-storage
176  CloseFile();
177  nRet = OpenFile();
178  if ( ERRCODE_NONE == nRet )
179  {
180  try
181  {
182  xRoot = xBlkRoot->openStorageElement( aPackageName, embed::ElementModes::READ );
183  bool bOasis = SotStorage::GetVersion( xRoot ) > SOFFICE_FILEFORMAT_60;
184 
185  uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement(
186  "atevent.xml", embed::ElementModes::READ );
187  OSL_ENSURE(xDocStream.is(), "Can't create stream");
188  if ( xDocStream.is() )
189  {
190  uno::Reference<io::XInputStream> xInputStream = xDocStream->getInputStream();
191 
192  // prepare ParserInputSrouce
193  xml::sax::InputSource aParserInput;
194  aParserInput.sSystemId = m_aName;
195  aParserInput.aInputStream = xInputStream;
196 
197  // get service factory
198  uno::Reference< uno::XComponentContext > xContext =
200 
201  // get parser
202  uno::Reference< xml::sax::XParser > xParser = xml::sax::Parser::create( xContext );
203 
204  // create descriptor and reference to it. Either
205  // both or neither must be kept because of the
206  // reference counting!
207  SvMacroTableEventDescriptor* pDescriptor =
208  new SvMacroTableEventDescriptor(aAutotextEvents);
209  uno::Reference<XNameReplace> xReplace = pDescriptor;
210  Sequence<Any> aFilterArguments( 1 );
211  aFilterArguments[0] <<= xReplace;
212 
213  // get filter
214  OUString sFilterComponent = bOasis
215  ? OUString("com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter")
216  : OUString("com.sun.star.comp.Writer.XMLAutotextEventsImporter");
217  uno::Reference< xml::sax::XDocumentHandler > xFilter(
218  xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
219  sFilterComponent, aFilterArguments, xContext),
220  UNO_QUERY );
221  OSL_ENSURE( xFilter.is(),
222  "can't instantiate atevent filter");
223  if ( xFilter.is() )
224  {
225  // connect parser and filter
226  xParser->setDocumentHandler( xFilter );
227 
228  // parse the stream
229  try
230  {
231  xParser->parseStream( aParserInput );
232  }
233  catch( xml::sax::SAXParseException& )
234  {
235  // workaround for #83452#: SetSize doesn't work
236  // nRet = ERR_SWG_READ_ERROR;
237  }
238  catch( xml::sax::SAXException& )
239  {
240  nRet = ERR_SWG_READ_ERROR;
241  }
242  catch( io::IOException& )
243  {
244  nRet = ERR_SWG_READ_ERROR;
245  }
246 
247  // and finally, copy macro into table
248  if (ERRCODE_NONE == nRet)
249  pDescriptor->copyMacrosIntoTable(rMacroTable);
250  }
251  else
252  nRet = ERR_SWG_READ_ERROR;
253  }
254  else
255  nRet = ERR_SWG_READ_ERROR;
256  }
257  catch( uno::Exception& )
258  {
259  nRet = ERR_SWG_READ_ERROR;
260  }
261  }
262  else
263  nRet = ERR_SWG_READ_ERROR;
264 
265  // success!
266  return nRet;
267 }
268 
269 ErrCode SwXMLTextBlocks::GetBlockText( const OUString& rShort, OUString& rText )
270 {
271  OUString aFolderName = GeneratePackageName ( rShort );
272  OUString aStreamName = aFolderName + ".xml";
273  rText.clear();
274 
275  try
276  {
277  bool bTextOnly = true;
278 
279  xRoot = xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ );
280  uno::Reference < container::XNameAccess > xAccess( xRoot, uno::UNO_QUERY );
281  if ( !xAccess->hasByName( aStreamName ) || !xRoot->isStreamElement( aStreamName ) )
282  {
283  bTextOnly = false;
284  aStreamName = "content.xml";
285  }
286 
287  uno::Reference < io::XStream > xContents = xRoot->openStreamElement( aStreamName, embed::ElementModes::READ );
288  uno::Reference< uno::XComponentContext > xContext =
290 
291  xml::sax::InputSource aParserInput;
292  aParserInput.sSystemId = m_aName;
293  aParserInput.aInputStream = xContents->getInputStream();
294 
295  // get filter
296  uno::Reference< xml::sax::XFastDocumentHandler > xFilter = new SwXMLTextBlockImport( xContext, rText, bTextOnly );
297  uno::Reference< xml::sax::XFastTokenHandler > xTokenHandler = new SwXMLTextBlockTokenHandler();
298 
299  // connect parser and filter
300  uno::Reference< xml::sax::XFastParser > xParser = xml::sax::FastParser::create(xContext);
301  xParser->setFastDocumentHandler( xFilter );
302  xParser->setTokenHandler( xTokenHandler );
303 
304  xParser->registerNamespace( "urn:oasis:names:tc:opendocument:xmlns:office:1.0", FastToken::NAMESPACE | XML_NAMESPACE_OFFICE );
305  xParser->registerNamespace( "urn:oasis:names:tc:opendocument:xmlns:text:1.0", FastToken::NAMESPACE | XML_NAMESPACE_TEXT );
306 
307  // parse
308  try
309  {
310  xParser->parseStream( aParserInput );
311  }
312  catch( xml::sax::SAXParseException& )
313  {
314  // re throw ?
315  }
316  catch( xml::sax::SAXException& )
317  {
318  // re throw ?
319  }
320  catch( io::IOException& )
321  {
322  // re throw ?
323  }
324 
325  xRoot = nullptr;
326  }
327  catch ( uno::Exception& )
328  {
329  OSL_FAIL( "Tried to open non-existent folder or stream!");
330  }
331 
332  return ERRCODE_NONE;
333 }
334 
335 ErrCode SwXMLTextBlocks::PutBlockText( const OUString& rShort,
336  const OUString& rText, const OUString& rPackageName )
337 {
338  GetIndex ( rShort );
339  /*
340  if (xBlkRoot->IsContained ( rPackageName ) )
341  {
342  xBlkRoot->Remove ( rPackageName );
343  xBlkRoot->Commit ( );
344  }
345  */
346  OUString aStreamName = rPackageName + ".xml";
347 
348  uno::Reference< uno::XComponentContext > xContext =
350 
351  uno::Reference < xml::sax::XWriter > xWriter = xml::sax::Writer::create(xContext);
352  ErrCode nRes = ERRCODE_NONE;
353 
354  try
355  {
356  xRoot = xBlkRoot->openStorageElement( rPackageName, embed::ElementModes::WRITE );
357  uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement( aStreamName,
358  embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE );
359 
360  uno::Reference < beans::XPropertySet > xSet( xDocStream, uno::UNO_QUERY );
361  xSet->setPropertyValue("MediaType", Any(OUString( "text/xml" )) );
362  uno::Reference < io::XOutputStream > xOut = xDocStream->getOutputStream();
363  uno::Reference<io::XActiveDataSource> xSrc(xWriter, uno::UNO_QUERY);
364  xSrc->setOutputStream(xOut);
365 
366  uno::Reference<xml::sax::XDocumentHandler> xHandler(xWriter,
367  uno::UNO_QUERY);
368 
370 
371  xExp->exportDoc( rText );
372 
373  uno::Reference < embed::XTransactedObject > xTrans( xRoot, uno::UNO_QUERY );
374  if ( xTrans.is() )
375  xTrans->commit();
376 
377  if (! (nFlags & SwXmlFlags::NoRootCommit) )
378  {
379  uno::Reference < embed::XTransactedObject > xTmpTrans( xBlkRoot, uno::UNO_QUERY );
380  if ( xTmpTrans.is() )
381  xTmpTrans->commit();
382  }
383  }
384  catch ( uno::Exception& )
385  {
386  nRes = ERR_SWG_WRITE_ERROR;
387  }
388 
389  xRoot = nullptr;
390 
391  //TODO/LATER: error handling
392  /*
393  sal_uLong nErr = xBlkRoot->GetError();
394  sal_uLong nRes = 0;
395  if( nErr == SVSTREAM_DISK_FULL )
396  nRes = ERR_W4W_WRITE_FULL;
397  else if( nErr != ERRCODE_NONE )
398  nRes = ERR_SWG_WRITE_ERROR;
399  */
400  if( !nRes ) // So that we can access the Doc via GetText & nCur
401  MakeBlockText( rText );
402 
403  return nRes;
404 }
405 
407 {
408  try
409  {
410  const OUString sDocName( XMLN_BLOCKLIST );
411  uno::Reference < container::XNameAccess > xAccess( xBlkRoot, uno::UNO_QUERY );
412  if ( xAccess.is() && xAccess->hasByName( sDocName ) && xBlkRoot->isStreamElement( sDocName ) )
413  {
414  uno::Reference< uno::XComponentContext > xContext =
416 
417  xml::sax::InputSource aParserInput;
418  aParserInput.sSystemId = sDocName;
419 
420  uno::Reference < io::XStream > xDocStream = xBlkRoot->openStreamElement( sDocName, embed::ElementModes::READ );
421  aParserInput.aInputStream = xDocStream->getInputStream();
422 
423  // get filter
424  uno::Reference< xml::sax::XFastDocumentHandler > xFilter = new SwXMLBlockListImport( xContext, *this );
425  uno::Reference< xml::sax::XFastTokenHandler > xTokenHandler = new SwXMLBlockListTokenHandler();
426 
427  // connect parser and filter
428  uno::Reference< xml::sax::XFastParser > xParser = xml::sax::FastParser::create(xContext);
429  xParser->setFastDocumentHandler( xFilter );
430  xParser->registerNamespace( "http://openoffice.org/2001/block-list", FastToken::NAMESPACE | XML_NAMESPACE_BLOCKLIST );
431  xParser->setTokenHandler( xTokenHandler );
432 
433  // parse
434  try
435  {
436  xParser->parseStream( aParserInput );
437  }
438  catch( xml::sax::SAXParseException& )
439  {
440  // re throw ?
441  }
442  catch( xml::sax::SAXException& )
443  {
444  // re throw ?
445  }
446  catch( io::IOException& )
447  {
448  // re throw ?
449  }
450  }
451  }
452  catch ( uno::Exception& )
453  {
454  }
455 }
457 {
458  if ( xBlkRoot.is() || ERRCODE_NONE == OpenFile ( false ) )
459  {
460  uno::Reference< uno::XComponentContext > xContext =
462 
463  uno::Reference < xml::sax::XWriter > xWriter = xml::sax::Writer::create(xContext);
464  OUString sDocName( XMLN_BLOCKLIST );
465 
466  /*
467  if ( xBlkRoot->IsContained( sDocName) )
468  {
469  xBlkRoot->Remove ( sDocName );
470  xBlkRoot->Commit();
471  }
472  */
473 
474  try
475  {
476  uno::Reference < io::XStream > xDocStream = xBlkRoot->openStreamElement( sDocName,
477  embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE );
478 
479  uno::Reference < beans::XPropertySet > xSet( xDocStream, uno::UNO_QUERY );
480  xSet->setPropertyValue("MediaType", Any(OUString( "text/xml" )) );
481  uno::Reference < io::XOutputStream > xOut = xDocStream->getOutputStream();
482  uno::Reference<io::XActiveDataSource> xSrc(xWriter, uno::UNO_QUERY);
483  xSrc->setOutputStream(xOut);
484 
485  uno::Reference<xml::sax::XDocumentHandler> xHandler(xWriter, uno::UNO_QUERY);
486 
487  rtl::Reference<SwXMLBlockListExport> xExp(new SwXMLBlockListExport( xContext, *this, XMLN_BLOCKLIST, xHandler) );
488 
489  xExp->exportDoc( XML_BLOCK_LIST );
490 
491  uno::Reference < embed::XTransactedObject > xTrans( xBlkRoot, uno::UNO_QUERY );
492  if ( xTrans.is() )
493  xTrans->commit();
494  }
495  catch ( uno::Exception& )
496  {
497  }
498 
499  m_bInfoChanged = false;
500  return;
501  }
502 }
503 
505  sal_uInt16 nIdx,
506  const SvxMacroTableDtor& rMacroTable )
507 {
508  // set current autotext
509  m_aShort = m_aNames[nIdx]->aShort;
510  m_aLong = m_aNames[nIdx]->aLong;
511  aPackageName = m_aNames[nIdx]->aPackageName;
512 
513  // start XML autotext event export
514  ErrCode nRes = ERRCODE_NONE;
515 
516  uno::Reference< uno::XComponentContext > xContext =
518 
519  // Get model
520  uno::Reference< lang::XComponent > xModelComp(
521  m_xDoc->GetDocShell()->GetModel(), UNO_QUERY );
522  OSL_ENSURE( xModelComp.is(), "XMLWriter::Write: got no model" );
523  if( !xModelComp.is() )
524  return ERR_SWG_WRITE_ERROR;
525 
526  // open stream in proper sub-storage
527  CloseFile(); // close (it may be open in read-only-mode)
528  nRes = OpenFile ( false );
529 
530  if ( ERRCODE_NONE == nRes )
531  {
532  try
533  {
534  xRoot = xBlkRoot->openStorageElement( aPackageName, embed::ElementModes::WRITE );
535  bool bOasis = SotStorage::GetVersion( xRoot ) > SOFFICE_FILEFORMAT_60;
536 
537  uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement( "atevent.xml",
538  embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE );
539 
540  uno::Reference < beans::XPropertySet > xSet( xDocStream, uno::UNO_QUERY );
541  xSet->setPropertyValue("MediaType", Any(OUString( "text/xml" )) );
542  uno::Reference < io::XOutputStream > xOutputStream = xDocStream->getOutputStream();
543 
544  // get XML writer
545  uno::Reference< xml::sax::XWriter > xSaxWriter =
546  xml::sax::Writer::create( xContext );
547 
548  // connect XML writer to output stream
549  xSaxWriter->setOutputStream( xOutputStream );
550  uno::Reference<xml::sax::XDocumentHandler> xDocHandler(
551  xSaxWriter, UNO_QUERY);
552 
553  // construct events object
554  uno::Reference<XNameAccess> xEvents =
555  new SvMacroTableEventDescriptor(rMacroTable,aAutotextEvents);
556 
557  // prepare arguments (prepend doc handler to given arguments)
558  Sequence<Any> aParams(2);
559  aParams[0] <<= xDocHandler;
560  aParams[1] <<= xEvents;
561 
562  // get filter component
563  OUString sFilterComponent = bOasis
564  ? OUString("com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter")
565  : OUString("com.sun.star.comp.Writer.XMLAutotextEventsExporter");
566  uno::Reference< document::XExporter > xExporter(
567  xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
568  sFilterComponent, aParams, xContext), UNO_QUERY);
569  OSL_ENSURE( xExporter.is(),
570  "can't instantiate export filter component" );
571  if( xExporter.is() )
572  {
573  // connect model and filter
574  xExporter->setSourceDocument( xModelComp );
575 
576  // filter!
577  Sequence<beans::PropertyValue> aFilterProps( 0 );
578  uno::Reference < document::XFilter > xFilter( xExporter,
579  UNO_QUERY );
580  xFilter->filter( aFilterProps );
581  }
582  else
583  nRes = ERR_SWG_WRITE_ERROR;
584 
585  // finally, commit stream, sub-storage and storage
586  uno::Reference < embed::XTransactedObject > xTmpTrans( xRoot, uno::UNO_QUERY );
587  if ( xTmpTrans.is() )
588  xTmpTrans->commit();
589 
590  uno::Reference < embed::XTransactedObject > xTrans( xBlkRoot, uno::UNO_QUERY );
591  if ( xTrans.is() )
592  xTrans->commit();
593 
594  xRoot = nullptr;
595  }
596  catch ( uno::Exception& )
597  {
598  nRes = ERR_SWG_WRITE_ERROR;
599  }
600 
601  CloseFile();
602  }
603  else
604  nRes = ERR_SWG_WRITE_ERROR;
605 
606  return nRes;
607 }
608 
609 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const struct SvEventDescription aAutotextEvents[]
#define ERR_SWG_WRITE_ERROR
Definition: swerror.h:30
sal_Int32 GetVersion() const
virtual ErrCode SetMacroTable(sal_uInt16 nIdx, const SvxMacroTableDtor &rMacroTable) override
ErrCode PutBlockText(const OUString &rShort, const OUString &rText, const OUString &rPackageName)
XML_UNFORMATTED_TEXT
const char XMLN_BLOCKLIST[]
Reader * ReadXML
Definition: fltini.cxx:65
Reference< XInputStream > xStream
void SetBlockMode(bool bSet)
Definition: shellio.hxx:254
#define SOFFICE_FILEFORMAT_60
SwDoc * GetDoc() const
virtual ErrCode GetMacroTable(sal_uInt16, SvxMacroTableDtor &rMacroTable) override
XML_BLOCK_LIST
#define ERRCODE_NONE
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
Reference< XComponentContext > getProcessComponentContext()
ErrCode GetBlockText(const OUString &rShort, OUString &rText)
#define ERR_SWG_READ_ERROR
Definition: swerror.h:25
void copyMacrosIntoTable(SvxMacroTableDtor &aFmt)