LibreOffice Module sw (master)  1
swblocks.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 <algorithm>
21 
22 #include <osl/diagnose.h>
23 #include <sfx2/docfilt.hxx>
24 #include <sot/storage.hxx>
25 #include <tools/urlobj.hxx>
26 #include <svl/fstathelper.hxx>
27 #include <svl/macitem.hxx>
28 #include <unotools/charclass.hxx>
29 #include <frmfmt.hxx>
30 #include <doc.hxx>
31 #include <docary.hxx>
32 #include <pam.hxx>
33 #include <shellio.hxx>
34 #include <swblocks.hxx>
35 #include <ndtxt.hxx>
36 #include <mdiexp.hxx>
37 #include <SwXMLTextBlocks.hxx>
38 #include <docsh.hxx>
39 #include <swunohelper.hxx>
40 
41 #include <swerror.h>
42 
46 sal_uInt16 SwImpBlocks::Hash( const OUString& r )
47 {
48  sal_uInt16 n = 0;
49  // std::min requires an explicit cast to sal_Int32 on 32bit platforms
50  const sal_Int32 nLen = std::min(r.getLength(), static_cast<sal_Int32>(8));
51  for (sal_Int32 i=0; i<nLen; ++i)
52  {
53  n = ( n << 1 ) + r[i];
54  }
55  return n;
56 }
57 
58 SwBlockName::SwBlockName( const OUString& rShort, const OUString& rLong )
59  : aShort( rShort ), aLong( rLong ), aPackageName (rShort),
60  bIsOnlyTextFlagInit( false ), bIsOnlyText( false )
61 {
62  nHashS = SwImpBlocks::Hash( rShort );
63  nHashL = SwImpBlocks::Hash( rLong );
64 }
65 
66 SwBlockName::SwBlockName( const OUString& rShort, const OUString& rLong, const OUString& rPackageName)
67  : aShort( rShort ), aLong( rLong ), aPackageName (rPackageName),
68  bIsOnlyTextFlagInit( false ), bIsOnlyText( false )
69 {
70  nHashS = SwImpBlocks::Hash( rShort );
71  nHashL = SwImpBlocks::Hash( rLong );
72 }
73 
78 {
79  if( !FStatHelper::IsDocument( rFile ) )
80  return FileType::NoFile;
82  return FileType::XML;
83  if( SotStorage::IsStorageFile( rFile ) )
84  return FileType::SW3;
85  //otherwise return NONE
86  return FileType::None;
87 }
88 
89 SwImpBlocks::SwImpBlocks( const OUString& rFile )
90  : m_aFile( rFile ),
91  m_aDateModified( Date::EMPTY ),
92  m_aTimeModified( tools::Time::EMPTY ),
93  m_nCurrentIndex( USHRT_MAX ),
94  m_bReadOnly( true ), m_bInPutMuchBlocks( false ),
95  m_bInfoChanged(false)
96 {
99  INetURLObject aObj(rFile);
100  aObj.setExtension( OUString() );
101  m_aName = aObj.GetBase();
102 }
103 
105 {
106 }
107 
112 {
113  m_xDoc->ClearDoc();
114 }
115 
119 std::unique_ptr<SwPaM> SwImpBlocks::MakePaM()
120 {
121  std::unique_ptr<SwPaM> pPam(new SwPaM( m_xDoc->GetNodes().GetEndOfContent() ));
122  pPam->Move( fnMoveBackward, GoInDoc );
123  pPam->SetMark();
124  pPam->Move( fnMoveForward, GoInDoc );
125  pPam->Exchange();
126  return pPam;
127 }
128 
129 sal_uInt16 SwImpBlocks::GetCount() const
130 {
131  return m_aNames.size();
132 }
133 
137 sal_uInt16 SwImpBlocks::GetIndex( const OUString& rShort ) const
138 {
139  const OUString s( GetAppCharClass().uppercase( rShort ) );
140  const sal_uInt16 nHash = Hash( s );
141  for( size_t i = 0; i < m_aNames.size(); i++ )
142  {
143  const SwBlockName* pName = m_aNames[ i ].get();
144  if( pName->nHashS == nHash
145  && pName->aShort == s )
146  return i;
147  }
148  return USHRT_MAX;
149 }
150 
151 sal_uInt16 SwImpBlocks::GetLongIndex( const OUString& rLong ) const
152 {
153  sal_uInt16 nHash = Hash( rLong );
154  for( size_t i = 0; i < m_aNames.size(); i++ )
155  {
156  const SwBlockName* pName = m_aNames[ i ].get();
157  if( pName->nHashL == nHash
158  && pName->aLong == rLong )
159  return i;
160  }
161  return USHRT_MAX;
162 }
163 
164 OUString SwImpBlocks::GetShortName( sal_uInt16 n ) const
165 {
166  if( n < m_aNames.size() )
167  return m_aNames[n]->aShort;
168  return OUString();
169 }
170 
171 OUString SwImpBlocks::GetLongName( sal_uInt16 n ) const
172 {
173  if( n < m_aNames.size() )
174  return m_aNames[n]->aLong;
175  return OUString();
176 }
177 
178 OUString SwImpBlocks::GetPackageName( sal_uInt16 n ) const
179 {
180  if( n < m_aNames.size() )
181  return m_aNames[n]->aPackageName;
182  return OUString();
183 }
184 
185 void SwImpBlocks::AddName( const OUString& rShort, const OUString& rLong,
186  bool bOnlyText )
187 {
188  sal_uInt16 nIdx = GetIndex( rShort );
189  if( nIdx != USHRT_MAX )
190  {
191  m_aNames.erase( m_aNames.begin() + nIdx );
192  }
193  std::unique_ptr<SwBlockName> pNew(new SwBlockName( rShort, rLong ));
194  pNew->bIsOnlyTextFlagInit = true;
195  pNew->bIsOnlyText = bOnlyText;
196  m_aNames.insert( std::move(pNew) );
197 }
198 
200 {
201  Date aTempDateModified( m_aDateModified );
202  tools::Time aTempTimeModified( m_aTimeModified );
203  return FStatHelper::GetModifiedDateTimeOfFile( m_aFile, &aTempDateModified, &aTempTimeModified ) &&
204  ( m_aDateModified != aTempDateModified ||
205  m_aTimeModified != aTempTimeModified );
206 }
207 
209 {
211 }
212 
213 bool SwImpBlocks::IsOnlyTextBlock( const OUString& ) const
214 {
215  return false;
216 }
217 
219 {
220  return ERRCODE_NONE;
221 }
222 
224 {
225  return ERRCODE_NONE;
226 }
227 
229 {
230  return false;
231 }
232 
233 SwTextBlocks::SwTextBlocks( const OUString& rFile )
234  : nErr( 0 )
235 {
236  INetURLObject aObj(rFile);
237  const OUString sFileName = aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
238  switch( SwImpBlocks::GetFileType( rFile ) )
239  {
240  case SwImpBlocks::FileType::XML: pImp.reset( new SwXMLTextBlocks( sFileName ) ); break;
241  case SwImpBlocks::FileType::NoFile: pImp.reset( new SwXMLTextBlocks( sFileName ) ); break;
242  default: break;
243  }
244  if( !pImp )
246 }
247 
249 {
250 }
251 
253 {
254  return pImp ? pImp->m_aName : OUString();
255 }
256 
257 void SwTextBlocks::SetName( const OUString& r )
258 {
259  if( pImp )
260  pImp->SetName( r );
261 }
262 
264 {
265  if (pImp)
266  {
267  SwImpBlocks::FileType nType = pImp->GetFileType();
268  if (SwImpBlocks::FileType::SW3 == nType)
269  return true;
270  }
271  return false;
272 }
273 
274 sal_uInt16 SwTextBlocks::GetCount() const
275 {
276  return pImp ? pImp->GetCount() : 0;
277 }
278 
279 sal_uInt16 SwTextBlocks::GetIndex( const OUString& r ) const
280 {
281  return pImp ? pImp->GetIndex( r ) : USHRT_MAX;
282 }
283 
284 sal_uInt16 SwTextBlocks::GetLongIndex( const OUString& r ) const
285 {
286  return pImp ? pImp->GetLongIndex( r ) : USHRT_MAX;
287 }
288 
289 OUString SwTextBlocks::GetShortName( sal_uInt16 n ) const
290 {
291  if( pImp )
292  return pImp->GetShortName( n );
293  return OUString();
294 }
295 
296 OUString SwTextBlocks::GetLongName( sal_uInt16 n ) const
297 {
298  if( pImp )
299  return pImp->GetLongName( n );
300  return OUString();
301 }
302 
303 bool SwTextBlocks::Delete( sal_uInt16 n )
304 {
305  if( pImp && !pImp->m_bInPutMuchBlocks )
306  {
307  if( pImp->IsFileChanged() )
309  else if( ERRCODE_NONE == (nErr = pImp->OpenFile( false ) ))
310  {
311  nErr = pImp->Delete( n );
312  if( !nErr )
313  {
314  pImp->m_aNames.erase( pImp->m_aNames.begin() + n );
315  }
316  if( n == pImp->m_nCurrentIndex )
317  pImp->m_nCurrentIndex = USHRT_MAX;
318  if( !nErr )
319  nErr = pImp->MakeBlockList();
320  }
321  pImp->CloseFile();
322  pImp->Touch();
323 
324  return ( nErr == ERRCODE_NONE );
325  }
326  return false;
327 }
328 
329 void SwTextBlocks::Rename( sal_uInt16 n, const OUString* s, const OUString* l )
330 {
331  if( pImp && !pImp->m_bInPutMuchBlocks )
332  {
333  pImp->m_nCurrentIndex = USHRT_MAX;
334  OUString aNew;
335  OUString aLong;
336  if( s )
337  aNew = aLong = *s;
338  if( l )
339  aLong = *l;
340  if( aNew.isEmpty() )
341  {
342  OSL_ENSURE( false, "No short name provided in the rename" );
344  return;
345  }
346 
347  if( pImp->IsFileChanged() )
349  else if( ERRCODE_NONE == ( nErr = pImp->OpenFile( false )))
350  {
351  // Set the new entry in the list before we do that!
352  aNew = GetAppCharClass().uppercase( aNew );
353  nErr = pImp->Rename( n, aNew, aLong );
354  if( !nErr )
355  {
356  bool bOnlyText = pImp->m_aNames[ n ]->bIsOnlyText;
357  pImp->m_aNames.erase( pImp->m_aNames.begin() + n );
358  pImp->AddName( aNew, aLong, bOnlyText );
359  nErr = pImp->MakeBlockList();
360  }
361  }
362  pImp->CloseFile();
363  pImp->Touch();
364  }
365 }
366 
367 bool SwTextBlocks::BeginGetDoc( sal_uInt16 n )
368 {
369  if( pImp && !pImp->m_bInPutMuchBlocks )
370  {
371  if( pImp->IsFileChanged() )
373  else if( ERRCODE_NONE == ( nErr = pImp->OpenFile()))
374  {
375  pImp->ClearDoc();
376  nErr = pImp->GetDoc( n );
377  if( nErr )
378  pImp->m_nCurrentIndex = USHRT_MAX;
379  else
380  pImp->m_nCurrentIndex = n;
381  }
382  return ( nErr == ERRCODE_NONE );
383  }
384  return false;
385 }
386 
388 {
389  if( pImp && !pImp->m_bInPutMuchBlocks )
390  pImp->CloseFile();
391 }
392 
393 bool SwTextBlocks::BeginPutDoc( const OUString& s, const OUString& l )
394 {
395  if( pImp )
396  {
397  bool bOk = pImp->m_bInPutMuchBlocks;
398  if( !bOk )
399  {
400  if( pImp->IsFileChanged() )
402  else
403  nErr = pImp->OpenFile( false );
404  bOk = ERRCODE_NONE == nErr;
405  }
406  if( bOk )
407  {
408  const OUString aNew = GetAppCharClass().uppercase(s);
409  nErr = pImp->BeginPutDoc( aNew, l );
410  }
411  if( nErr )
412  pImp->CloseFile();
413  }
414  return ERRCODE_NONE == nErr;
415 }
416 
418 {
419  sal_uInt16 nIdx = USHRT_MAX;
420  if( pImp )
421  {
422  nErr = pImp->PutDoc();
423  if( !nErr )
424  {
425  pImp->m_nCurrentIndex = GetIndex( pImp->m_aShort );
426  if( pImp->m_nCurrentIndex != USHRT_MAX )
427  pImp->m_aNames[ pImp->m_nCurrentIndex ]->aLong = pImp->m_aLong;
428  else
429  {
430  pImp->AddName( pImp->m_aShort, pImp->m_aLong );
431  pImp->m_nCurrentIndex = pImp->GetIndex( pImp->m_aShort );
432  }
433  if( !pImp->m_bInPutMuchBlocks )
434  nErr = pImp->MakeBlockList();
435  }
436  if( !pImp->m_bInPutMuchBlocks )
437  {
438  pImp->CloseFile();
439  pImp->Touch();
440  }
441  nIdx = pImp->m_nCurrentIndex;
442  }
443  return nIdx;
444 }
445 
446 sal_uInt16 SwTextBlocks::PutText( const OUString& rShort, const OUString& rName,
447  const OUString& rText )
448 {
449  sal_uInt16 nIdx = USHRT_MAX;
450  if( pImp )
451  {
452  bool bOk = pImp->m_bInPutMuchBlocks;
453  if( !bOk )
454  {
455  if( pImp->IsFileChanged() )
457  else
458  nErr = pImp->OpenFile( false );
459  bOk = ERRCODE_NONE == nErr;
460  }
461  if( bOk )
462  {
463  OUString aNew = GetAppCharClass().uppercase( rShort );
464  nErr = pImp->PutText( aNew, rName, rText );
465  pImp->m_nCurrentIndex = USHRT_MAX;
466  if( !nErr )
467  {
468  nIdx = GetIndex( pImp->m_aShort );
469  if( nIdx != USHRT_MAX )
470  pImp->m_aNames[ nIdx ]->aLong = rName;
471  else
472  {
473  pImp->AddName( pImp->m_aShort, rName, true );
474  nIdx = pImp->GetIndex( pImp->m_aShort );
475  }
476  if( !pImp->m_bInPutMuchBlocks )
477  nErr = pImp->MakeBlockList();
478  }
479  }
480  if( !pImp->m_bInPutMuchBlocks )
481  {
482  pImp->CloseFile();
483  pImp->Touch();
484  }
485  }
486  return nIdx;
487 }
488 
490 {
491  if( pImp )
492  return pImp->m_xDoc.get();
493  return nullptr;
494 }
495 
497 {
498  if( pImp )
499  {
500  pImp->ClearDoc();
501  pImp->m_nCurrentIndex = USHRT_MAX;
502  }
503 }
504 
505 OUString const & SwTextBlocks::GetFileName() const
506 {
507  return pImp->GetFileName();
508 }
509 
511 {
512  return pImp->m_bReadOnly;
513 }
514 
515 bool SwTextBlocks::IsOnlyTextBlock( sal_uInt16 nIdx ) const
516 {
517  bool bRet = false;
518  if( pImp && !pImp->m_bInPutMuchBlocks )
519  {
520  SwBlockName* pBlkNm = pImp->m_aNames[ nIdx ].get();
521  if( !pBlkNm->bIsOnlyTextFlagInit &&
522  !pImp->IsFileChanged() && !pImp->OpenFile() )
523  {
524  pBlkNm->bIsOnlyText = pImp->IsOnlyTextBlock( pBlkNm->aShort );
525  pBlkNm->bIsOnlyTextFlagInit = true;
526  pImp->CloseFile();
527  }
528  bRet = pBlkNm->bIsOnlyText;
529  }
530  return bRet;
531 }
532 
533 bool SwTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const
534 {
535  sal_uInt16 nIdx = pImp->GetIndex( rShort );
536  if( USHRT_MAX != nIdx )
537  {
538  if( pImp->m_aNames[ nIdx ]->bIsOnlyTextFlagInit )
539  return pImp->m_aNames[ nIdx ]->bIsOnlyText;
540  return IsOnlyTextBlock( nIdx );
541  }
542 
543  OSL_ENSURE( false, "Invalid name" );
544  return false;
545 }
546 
547 bool SwTextBlocks::GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTable )
548 {
549  bool bRet = true;
550  if ( pImp && !pImp->m_bInPutMuchBlocks )
551  bRet = ( ERRCODE_NONE == pImp->GetMacroTable( nIdx, rMacroTable ) );
552  return bRet;
553 }
554 
555 bool SwTextBlocks::SetMacroTable( sal_uInt16 nIdx, const SvxMacroTableDtor& rMacroTable )
556 {
557  bool bRet = true;
558  if ( pImp && !pImp->m_bInPutMuchBlocks )
559  bRet = ( ERRCODE_NONE == pImp->SetMacroTable( nIdx, rMacroTable ) );
560  return bRet;
561 }
562 
564 {
565  bool bRet = false;
566  if( !IsOld() && pImp )
567  bRet = pImp->PutMuchEntries( true );
568  return bRet;
569 }
570 
572 {
573  if( pImp )
574  pImp->PutMuchEntries( false );
575 }
576 
577 OUString SwTextBlocks::GetBaseURL() const
578 {
579  if(pImp)
580  return pImp->GetBaseURL();
581  return OUString();
582 }
583 
584 void SwTextBlocks::SetBaseURL( const OUString& rURL )
585 {
586  if(pImp)
587  pImp->SetBaseURL(rURL);
588 }
589 
590 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void ClearDoc()
Delete the document's content.
Definition: swblocks.cxx:111
void EndGetDoc()
Definition: swblocks.cxx:387
SVL_DLLPUBLIC bool IsDocument(const OUString &rURL)
bool IsOnlyTextBlock(sal_uInt16) const
Definition: swblocks.cxx:515
void SetName(const OUString &)
Definition: swblocks.cxx:257
virtual void AddName(const OUString &, const OUString &, bool bOnlyText=false)
Definition: swblocks.cxx:185
sal_uInt16 PutDoc()
Definition: swblocks.cxx:417
rtl::Reference< SwDoc > m_xDoc
Definition: swblocks.hxx:66
bool bIsOnlyTextFlagInit
Package name.
Definition: swblocks.hxx:42
sal_uInt16 GetIndex(const OUString &) const
Get count of Text Blocks.
Definition: swblocks.cxx:137
virtual ~SwImpBlocks()
Definition: swblocks.cxx:104
Definition: doc.hxx:185
OUString GetLongName(sal_uInt16) const
Definition: swblocks.cxx:296
void Rename(sal_uInt16, const OUString *, const OUString *)
Definition: swblocks.cxx:329
static bool IsStorageFile(OUString const &rFileName)
OUString const m_aFile
Definition: swblocks.hxx:58
virtual ErrCode SetMacroTable(sal_uInt16 nIdx, const SvxMacroTableDtor &rMacroTable)
Definition: swblocks.cxx:223
tools::Time m_aTimeModified
Definition: swblocks.hxx:65
OUString GetBase() const
FUNC_TYPE const nType
bool setExtension(OUString const &rTheExtension, sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
SwBlockName(const OUString &rShort, const OUString &rLong)
Unformatted text.
Definition: swblocks.cxx:58
sal_uInt16 GetCount() const
Hashcode for Block names.
Definition: swblocks.cxx:129
SwImpBlocks(const OUString &)
Definition: swblocks.cxx:89
bool BeginGetDoc(sal_uInt16)
Definition: swblocks.cxx:367
size_type size() const
bool IsFileChanged() const
Definition: swblocks.cxx:199
virtual bool IsOnlyTextBlock(const OUString &rShort) const
Definition: swblocks.cxx:213
virtual ErrCode GetMacroTable(sal_uInt16 nIdx, SvxMacroTableDtor &rMacroTable)
Definition: swblocks.cxx:218
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
#define ERR_TXTBLOCK_NEWFILE_ERROR
Definition: swerror.h:34
void SetBaseURL(const OUString &rURL)
Definition: swblocks.cxx:584
sal_uInt16 PutText(const OUString &, const OUString &, const OUString &)
Definition: swblocks.cxx:446
OUString GetName()
Definition: swblocks.cxx:252
std::unique_ptr< SwImpBlocks > pImp
Definition: shellio.hxx:306
int i
virtual FileType GetFileType() const =0
sal_uInt16 GetLongIndex(const OUString &) const
Definition: swblocks.cxx:284
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
sal_uInt16 GetLongIndex(const OUString &) const
Index for shortnames.
Definition: swblocks.cxx:151
void EndPutMuchBlockEntries()
Definition: swblocks.cxx:571
sal_uInt16 sal_Char * pName
bool GoInDoc(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:882
SwTextBlocks(const OUString &)
Definition: swblocks.cxx:233
bool IsOld() const
Definition: swblocks.cxx:263
bool IsReadOnly() const
Definition: swblocks.cxx:510
OUString GetShortName(sal_uInt16) const
Index for longnames.
Definition: swblocks.cxx:164
OUString GetLongName(sal_uInt16) const
Return shortname for index.
Definition: swblocks.cxx:171
OUString m_aName
Definition: swblocks.hxx:59
SwDoc * GetDoc()
Definition: swblocks.cxx:489
sal_uInt16 GetCount() const
Definition: swblocks.cxx:274
const_iterator begin() const
std::unique_ptr< SwPaM > MakePaM()
Creating a PaM, that spans the whole document.
Definition: swblocks.cxx:119
bool BeginPutDoc(const OUString &, const OUString &)
Definition: swblocks.cxx:393
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool Delete(sal_uInt16)
Definition: swblocks.cxx:303
OUString GetBaseURL() const
Definition: swblocks.cxx:577
bool GetMacroTable(sal_uInt16 nIdx, SvxMacroTableDtor &rMacroTable)
Definition: swblocks.cxx:547
#define ERRCODE_NONE
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
OUString aLong
Shortname.
Definition: swblocks.hxx:40
sal_uInt16 GetIndex(const OUString &) const
Definition: swblocks.cxx:279
#define ERR_SWG_INTERNAL_ERROR
Definition: swerror.h:33
bool bIsOnlyText
Is the Flag valid?
Definition: swblocks.hxx:43
sal_uInt16 nHashS
Definition: swblocks.hxx:37
SVL_DLLPUBLIC bool GetModifiedDateTimeOfFile(const OUString &rURL, Date *pDate, tools::Time *pTime)
void ClearDoc()
Definition: swblocks.cxx:496
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
OUString const aShort
Definition: swblocks.hxx:39
ErrCode nErr
Definition: shellio.hxx:307
Date m_aDateModified
Definition: swblocks.hxx:64
sal_uInt16 nHashL
Definition: swblocks.hxx:37
OUString GetPackageName(sal_uInt16) const
Return longname for index.
Definition: swblocks.cxx:178
OUString GetShortName(sal_uInt16) const
Definition: swblocks.cxx:289
bool SetMacroTable(sal_uInt16 nIdx, const SvxMacroTableDtor &rMacroTable)
Definition: swblocks.cxx:555
std::pair< const_iterator, bool > insert(Value &&x)
virtual bool PutMuchEntries(bool bOn)
Definition: swblocks.cxx:228
CharClass & GetAppCharClass()
Definition: init.cxx:751
SwBlockNames m_aNames
Definition: swblocks.hxx:63
bool StartPutMuchBlockEntries()
Definition: swblocks.cxx:563
static bool IsFileUCBStorage(const OUString &rFileName)
#define ERR_SWG_FILE_FORMAT_ERROR
Definition: swerror.h:24
OUString const & GetFileName() const
Definition: swblocks.cxx:505
static sal_uInt16 Hash(const OUString &)
Calculate hash code (is not guaranteed to be unique)
Definition: swblocks.cxx:46
size_type erase(const Value &x)
void Touch()
Definition: swblocks.cxx:208