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