LibreOffice Module sw (master)  1
glosdoc.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 <com/sun/star/container/XNamed.hpp>
24 
26 
27 #include <vcl/errinf.hxx>
28 #include <osl/diagnose.h>
29 #include <rtl/character.hxx>
30 #include <svl/urihelper.hxx>
31 #include <svl/fstathelper.hxx>
32 #include <unotools/pathoptions.hxx>
33 #include <unotools/tempfile.hxx>
34 #include <swtypes.hxx>
35 #include <glosdoc.hxx>
36 #include <shellio.hxx>
37 #include <swunohelper.hxx>
38 
39 #include <unoatxt.hxx>
40 #include <swerror.h>
41 
42 #include <memory>
43 
44 using namespace ::com::sun::star;
45 using namespace ::com::sun::star::uno;
46 
47 namespace
48 {
49 
50 OUString lcl_FullPathName(const OUString& sPath, const OUString& sName)
51 {
52  return sPath + "/" + sName + SwGlossaries::GetExtension();
53 }
54 
55 OUString lcl_CheckFileName( const OUString& rNewFilePath,
56  const OUString& rNewGroupName )
57 {
58  const sal_Int32 nLen = rNewGroupName.getLength();
59  OUStringBuffer aBuf(nLen);
60  //group name should contain only A-Z and a-z and spaces
61  for( sal_Int32 i=0; i < nLen; ++i )
62  {
63  const sal_Unicode cChar = rNewGroupName[i];
64  if (rtl::isAsciiAlphanumeric(cChar) ||
65  cChar == '_' || cChar == 0x20)
66  {
67  aBuf.append(cChar);
68  }
69  }
70 
71  const OUString sRet = aBuf.makeStringAndClear().trim();
72  if ( !sRet.isEmpty() )
73  {
74  if (!FStatHelper::IsDocument( lcl_FullPathName(rNewFilePath, sRet) ))
75  return sRet;
76  }
77 
78  OUString rSG = SwGlossaries::GetExtension();
79  //generate generic name
80  utl::TempFile aTemp("group", true, &rSG, &rNewFilePath);
81  aTemp.EnableKillingFile();
82 
83  INetURLObject aTempURL( aTemp.GetURL() );
84  return aTempURL.GetBase();
85 }
86 
87 }
88 
89 // supplies the default group's name
91 {
92  return "standard";
93 
94 }
95 
96 // supplies the number of text block groups
98 {
99  return GetNameList().size();
100 }
101 
102 // supplies the group's name
103 bool SwGlossaries::FindGroupName(OUString& rGroup)
104 {
105  // if the group name doesn't contain a path, a suitable group entry
106  // can the searched for here;
107  const size_t nCount = GetGroupCnt();
108  for(size_t i = 0; i < nCount; ++i)
109  {
110  const OUString sTemp(GetGroupName(i));
111  if (rGroup==sTemp.getToken(0, GLOS_DELIM))
112  {
113  rGroup = sTemp;
114  return true;
115  }
116  }
117  // you can search two times because for more directories the case sensitive
118  // name could occur multiple times
119  const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
120  for(size_t i = 0; i < nCount; ++i)
121  {
122  const OUString sTemp( GetGroupName( i ));
123  sal_uInt16 nPath = sTemp.getToken(1, GLOS_DELIM).toUInt32();
124 
126  && rSCmp.isEqual( rGroup, sTemp.getToken( 0, GLOS_DELIM) ) )
127  {
128  rGroup = sTemp;
129  return true;
130  }
131  }
132  return false;
133 }
134 
135 OUString const & SwGlossaries::GetGroupName(size_t nGroupId)
136 {
137  OSL_ENSURE(nGroupId < m_GlosArr.size(),
138  "SwGlossaries::GetGroupName: index out of bounds");
139  return m_GlosArr[nGroupId];
140 }
141 
142 OUString SwGlossaries::GetGroupTitle( const OUString& rGroupName )
143 {
144  OUString sRet;
145  OUString sGroup(rGroupName);
146  if (sGroup.indexOf(GLOS_DELIM)<0)
147  FindGroupName(sGroup);
148  std::unique_ptr<SwTextBlocks> pGroup = GetGroupDoc(sGroup);
149  if(pGroup)
150  {
151  sRet = pGroup->GetName();
152  }
153  return sRet;
154 }
155 
156 // supplies the group rName's text block document
157 std::unique_ptr<SwTextBlocks> SwGlossaries::GetGroupDoc(const OUString &rName,
158  bool bCreate)
159 {
160  // insert to the list of text blocks if applicable
161  if(bCreate && !m_GlosArr.empty())
162  {
163  if (std::none_of(m_GlosArr.begin(), m_GlosArr.end(),
164  [&rName](const OUString& rEntry) { return rEntry == rName; }))
165  { // block not in the list
166  m_GlosArr.push_back(rName);
167  }
168  }
169  return GetGlosDoc( rName, bCreate );
170 }
171 
172 // Creates a new document with the group name. temporarily also created as file
173 // so that groups remain there later (without access).
174 bool SwGlossaries::NewGroupDoc(OUString& rGroupName, const OUString& rTitle)
175 {
176  const OUString sNewPath(rGroupName.getToken(1, GLOS_DELIM));
177  sal_uInt16 nNewPath = static_cast<sal_uInt16>(sNewPath.toInt32());
178  if (static_cast<size_t>(nNewPath) >= m_PathArr.size())
179  return false;
180  const OUString sNewFilePath(m_PathArr[nNewPath]);
181  const OUString sNewGroup = lcl_CheckFileName(sNewFilePath, rGroupName.getToken(0, GLOS_DELIM))
182  + OUStringChar(GLOS_DELIM) + sNewPath;
183  std::unique_ptr<SwTextBlocks> pBlock = GetGlosDoc( sNewGroup );
184  if(pBlock)
185  {
186  GetNameList().push_back(sNewGroup);
187  pBlock->SetName(rTitle);
188  rGroupName = sNewGroup;
189  return true;
190  }
191  return false;
192 }
193 
195  const OUString& rOldGroup, OUString& rNewGroup, const OUString& rNewTitle )
196 {
197  sal_uInt16 nOldPath = static_cast<sal_uInt16>(rOldGroup.getToken(1, GLOS_DELIM).toInt32());
198  if (static_cast<size_t>(nOldPath) >= m_PathArr.size())
199  return false;
200 
201  const OUString sOldFileURL =
202  lcl_FullPathName(m_PathArr[nOldPath], rOldGroup.getToken(0, GLOS_DELIM));
203 
204  if (!FStatHelper::IsDocument( sOldFileURL ))
205  {
206  OSL_FAIL("group doesn't exist!");
207  return false;
208  }
209 
210  sal_uInt16 nNewPath = static_cast<sal_uInt16>(rNewGroup.getToken(1, GLOS_DELIM).toInt32());
211  if (static_cast<size_t>(nNewPath) >= m_PathArr.size())
212  return false;
213 
214  const OUString sNewFileName = lcl_CheckFileName(m_PathArr[nNewPath],
215  rNewGroup.getToken(0, GLOS_DELIM));
216  const OUString sNewFileURL = lcl_FullPathName(m_PathArr[nNewPath], sNewFileName);
217 
218  if (FStatHelper::IsDocument( sNewFileURL ))
219  {
220  OSL_FAIL("group already exists!");
221  return false;
222  }
223 
224  if (!SWUnoHelper::UCB_MoveFile(sOldFileURL, sNewFileURL ))
225  return false;
226 
227  RemoveFileFromList( rOldGroup );
228 
229  rNewGroup = sNewFileName + OUStringChar(GLOS_DELIM) + OUString::number(nNewPath);
230  if (m_GlosArr.empty())
231  {
232  GetNameList();
233  }
234  else
235  {
236  m_GlosArr.push_back(rNewGroup);
237  }
238 
239  std::unique_ptr<SwTextBlocks> pNewBlock(new SwTextBlocks( sNewFileURL ));
240  pNewBlock->SetName(rNewTitle);
241 
242  return true;
243 }
244 
245 // Deletes a text block group
246 bool SwGlossaries::DelGroupDoc(const OUString &rName)
247 {
248  sal_uInt16 nPath = static_cast<sal_uInt16>(rName.getToken(1, GLOS_DELIM).toInt32());
249  if (static_cast<size_t>(nPath) >= m_PathArr.size())
250  return false;
251  const OUString sBaseName(rName.getToken(0, GLOS_DELIM));
252  const OUString sFileURL = lcl_FullPathName(m_PathArr[nPath], sBaseName);
253  const OUString aName = sBaseName + OUStringChar(GLOS_DELIM) + OUString::number(nPath);
254  // Even if the file doesn't exist it has to be deleted from
255  // the list of text block regions
256  // no && because of CFfront
257  bool bRemoved = SWUnoHelper::UCB_DeleteFile( sFileURL );
258  OSL_ENSURE(bRemoved, "file has not been removed");
259  RemoveFileFromList( aName );
260  return bRemoved;
261 }
262 
264 {
266 }
267 
268 // read a block document
269 std::unique_ptr<SwTextBlocks> SwGlossaries::GetGlosDoc( const OUString &rName, bool bCreate ) const
270 {
271  sal_uInt16 nPath = static_cast<sal_uInt16>(rName.getToken(1, GLOS_DELIM).toInt32());
272  std::unique_ptr<SwTextBlocks> pTmp;
273  if (static_cast<size_t>(nPath) < m_PathArr.size())
274  {
275  const OUString sFileURL =
276  lcl_FullPathName(m_PathArr[nPath], rName.getToken(0, GLOS_DELIM));
277 
278  bool bExist = false;
279  if(!bCreate)
280  bExist = FStatHelper::IsDocument( sFileURL );
281 
282  if (bCreate || bExist)
283  {
284  pTmp.reset(new SwTextBlocks( sFileURL ));
285  bool bOk = true;
286  if( pTmp->GetError() )
287  {
288  ErrorHandler::HandleError( pTmp->GetError() );
289  bOk = ! pTmp->GetError().IsError();
290  }
291 
292  if( bOk && pTmp->GetName().isEmpty() )
293  pTmp->SetName( rName );
294  }
295  }
296 
297  return pTmp;
298 }
299 
300 // access to the list of names; read in if applicable
301 std::vector<OUString> & SwGlossaries::GetNameList()
302 {
303  if (m_GlosArr.empty())
304  {
305  const OUString sExt( SwGlossaries::GetExtension() );
306  for (size_t i = 0; i < m_PathArr.size(); ++i)
307  {
308  std::vector<OUString> aFiles;
309 
311  for (const OUString& aTitle : aFiles)
312  {
313  const OUString sName( aTitle.copy( 0, aTitle.getLength() - sExt.getLength() )
314  + OUStringChar(GLOS_DELIM) + OUString::number( static_cast<sal_Int16>(i) ));
315  m_GlosArr.push_back(sName);
316  }
317  }
318  if (m_GlosArr.empty())
319  {
320  // the standard block is inside of the path's first part
321  m_GlosArr.emplace_back(SwGlossaries::GetDefName() + OUStringChar(GLOS_DELIM) + "0" );
322  }
323  }
324  return m_GlosArr;
325 }
326 
328 {
329  UpdateGlosPath(true);
330 }
331 
332 // set new path and recreate internal array
333 static OUString lcl_makePath(const std::vector<OUString>& rPaths)
334 {
335  std::vector<OUString>::const_iterator aIt(rPaths.begin());
336  const std::vector<OUString>::const_iterator aEnd(rPaths.end());
337  OUStringBuffer aPath(*aIt);
338  for (++aIt; aIt != aEnd; ++aIt)
339  {
340  aPath.append(SVT_SEARCHPATH_DELIMITER);
341  const INetURLObject aTemp(*aIt);
342  aPath.append(aTemp.GetFull());
343  }
344  return aPath.getStr();
345 }
346 
348 {
349  SvtPathOptions aPathOpt;
350  const OUString& aNewPath( aPathOpt.GetAutoTextPath() );
351  bool bPathChanged = m_aPath != aNewPath;
352  if (bFull || bPathChanged)
353  {
354  m_aPath = aNewPath;
355 
356  m_PathArr.clear();
357 
358  std::vector<OUString> aDirArr;
359  std::vector<OUString> aInvalidPaths;
360  if (!m_aPath.isEmpty())
361  {
362  sal_Int32 nIndex = 0;
363  do
364  {
365  const OUString sPth = URIHelper::SmartRel2Abs(
366  INetURLObject(),
367  m_aPath.getToken(0, SVT_SEARCHPATH_DELIMITER, nIndex),
369  if (!aDirArr.empty() &&
370  std::find(aDirArr.begin(), aDirArr.end(), sPth) != aDirArr.end())
371  {
372  continue;
373  }
374  aDirArr.push_back(sPth);
375  if( !FStatHelper::IsFolder( sPth ) )
376  aInvalidPaths.push_back(sPth);
377  else
378  m_PathArr.push_back(sPth);
379  }
380  while (nIndex>=0);
381  }
382 
383  if (m_aPath.isEmpty() || !aInvalidPaths.empty())
384  {
385  std::sort(aInvalidPaths.begin(), aInvalidPaths.end());
386  aInvalidPaths.erase(std::unique(aInvalidPaths.begin(), aInvalidPaths.end()), aInvalidPaths.end());
387  if (bPathChanged || (m_aInvalidPaths != aInvalidPaths))
388  {
389  m_aInvalidPaths = aInvalidPaths;
390  // wrong path, that means AutoText directory doesn't exist
391 
394  DialogMask::ButtonsOk | DialogMask::MessageError ) );
395  m_bError = true;
396  }
397  else
398  m_bError = false;
399  }
400  else
401  m_bError = false;
402 
403  if (!m_GlosArr.empty())
404  {
405  m_GlosArr.clear();
406  GetNameList();
407  }
408  }
409 }
410 
412 {
413  ErrCode nPathError = *new StringErrorInfo(ERR_AUTOPATH_ERROR,
414  lcl_makePath(m_aInvalidPaths), DialogMask::ButtonsOk );
415  ErrorHandler::HandleError( nPathError );
416 }
417 
419 {
420  return ".bau";
421 }
422 
423 void SwGlossaries::RemoveFileFromList( const OUString& rGroup )
424 {
425  if (!m_GlosArr.empty())
426  {
427  auto it = std::find(m_GlosArr.begin(), m_GlosArr.end(), rGroup);
428  if (it != m_GlosArr.end())
429  {
430  {
431  // tell the UNO AutoTextGroup object that it's not valid anymore
432  for ( UnoAutoTextGroups::iterator aLoop = m_aGlossaryGroups.begin();
433  aLoop != m_aGlossaryGroups.end();
434  )
435  {
436  Reference< container::XNamed > xNamed( aLoop->get(), UNO_QUERY );
437  if ( !xNamed.is() )
438  {
439  aLoop = m_aGlossaryGroups.erase(aLoop);
440  }
441  else if ( xNamed->getName() == rGroup )
442  {
443  static_cast< SwXAutoTextGroup* >( xNamed.get() )->Invalidate();
444  // note that this static_cast works because we know that the array only
445  // contains SwXAutoTextGroup implementation
446  m_aGlossaryGroups.erase( aLoop );
447  break;
448  } else
449  ++aLoop;
450  }
451  }
452 
453  {
454  // tell all our UNO AutoTextEntry objects that they're not valid anymore
455  for ( UnoAutoTextEntries::iterator aLoop = m_aGlossaryEntries.begin();
456  aLoop != m_aGlossaryEntries.end();
457  )
458  {
459  auto pEntry = comphelper::getUnoTunnelImplementation<SwXAutoTextEntry>(aLoop->get());
460  if ( pEntry && ( pEntry->GetGroupName() == rGroup ) )
461  {
462  pEntry->Invalidate();
463  aLoop = m_aGlossaryEntries.erase( aLoop );
464  }
465  else
466  ++aLoop;
467  }
468  }
469 
470  m_GlosArr.erase(it);
471  }
472  }
473 }
474 
475 OUString SwGlossaries::GetCompleteGroupName( const OUString& rGroupName )
476 {
477  const size_t nCount = GetGroupCnt();
478  // when the group name was created internally the path is here as well
479  sal_Int32 nIndex = 0;
480  const OUString sGroupName(rGroupName.getToken(0, GLOS_DELIM, nIndex));
481  const bool bPathLen = !rGroupName.getToken(0, GLOS_DELIM, nIndex).isEmpty();
482  for ( size_t i = 0; i < nCount; i++ )
483  {
484  const OUString sGrpName = GetGroupName(i);
485  if (bPathLen)
486  {
487  if (rGroupName == sGrpName)
488  return sGrpName;
489  }
490  else
491  {
492  if (sGroupName == sGrpName.getToken(0, GLOS_DELIM))
493  return sGrpName;
494  }
495  }
496  return OUString();
497 }
498 
500 {
501  // invalidate all the AutoTextGroup-objects
502  for (const auto& rGroup : m_aGlossaryGroups)
503  {
504  Reference< text::XAutoTextGroup > xGroup( rGroup.get(), UNO_QUERY );
505  if ( xGroup.is() )
506  static_cast< SwXAutoTextGroup* >( xGroup.get() )->Invalidate();
507  }
508  UnoAutoTextGroups aTmpg;
509  m_aGlossaryGroups.swap( aTmpg );
510 
511  // invalidate all the AutoTextEntry-objects
512  for (const auto& rEntry : m_aGlossaryEntries)
513  {
514  auto pEntry = comphelper::getUnoTunnelImplementation<SwXAutoTextEntry>(rEntry.get());
515  if ( pEntry )
516  pEntry->Invalidate();
517  }
518  UnoAutoTextEntries aTmpe;
519  m_aGlossaryEntries.swap( aTmpe );
520 }
521 
522 Reference< text::XAutoTextGroup > SwGlossaries::GetAutoTextGroup( const OUString& _rGroupName )
523 {
524  bool _bCreate = true;
525  // first, find the name with path-extension
526  const OUString sCompleteGroupName = GetCompleteGroupName( _rGroupName );
527 
528  Reference< text::XAutoTextGroup > xGroup;
529 
530  // look up the group in the cache
531  UnoAutoTextGroups::iterator aSearch = m_aGlossaryGroups.begin();
532  for ( ; aSearch != m_aGlossaryGroups.end(); )
533  {
534  auto pSwGroup = comphelper::getUnoTunnelImplementation<SwXAutoTextGroup>(aSearch->get());
535  if ( !pSwGroup )
536  {
537  // the object is dead in the meantime -> remove from cache
538  aSearch = m_aGlossaryGroups.erase( aSearch );
539  continue;
540  }
541 
542  if ( _rGroupName == pSwGroup->getName() )
543  { // the group is already cached
544  if ( !sCompleteGroupName.isEmpty() )
545  { // the group still exists -> return it
546  xGroup = pSwGroup;
547  break;
548  }
549  else
550  {
551  // this group does not exist (anymore) -> release the cached UNO object for it
552  aSearch = m_aGlossaryGroups.erase( aSearch );
553  // so it won't be created below
554  _bCreate = false;
555  break;
556  }
557  }
558 
559  ++aSearch;
560  }
561 
562  if ( !xGroup.is() && _bCreate )
563  {
564  xGroup = new SwXAutoTextGroup( sCompleteGroupName, this );
565  // cache it
566  m_aGlossaryGroups.emplace_back( xGroup );
567  }
568 
569  return xGroup;
570 }
571 
572 Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry(
573  const OUString& rCompleteGroupName,
574  const OUString& rGroupName,
575  const OUString& rEntryName )
576 {
577  //standard must be created
578  bool bCreate = ( rCompleteGroupName == GetDefName() );
579  std::unique_ptr< SwTextBlocks > pGlosGroup( GetGroupDoc( rCompleteGroupName, bCreate ) );
580 
581  if (!pGlosGroup || pGlosGroup->GetError())
582  throw lang::WrappedTargetException();
583 
584  sal_uInt16 nIdx = pGlosGroup->GetIndex( rEntryName );
585  if ( USHRT_MAX == nIdx )
586  throw container::NoSuchElementException();
587 
588  Reference< text::XAutoTextEntry > xReturn;
589 
590  UnoAutoTextEntries::iterator aSearch( m_aGlossaryEntries.begin() );
591  for ( ; aSearch != m_aGlossaryEntries.end(); )
592  {
593  Reference< lang::XUnoTunnel > xEntryTunnel( aSearch->get(), UNO_QUERY );
594 
595  SwXAutoTextEntry* pEntry = nullptr;
596  if ( xEntryTunnel.is() )
597  pEntry = reinterpret_cast< SwXAutoTextEntry* >( xEntryTunnel->getSomething( SwXAutoTextEntry::getUnoTunnelId() ) );
598  else
599  {
600  // the object is dead in the meantime -> remove from cache
601  aSearch = m_aGlossaryEntries.erase( aSearch );
602  continue;
603  }
604 
605  if ( pEntry
606  && pEntry->GetGroupName() == rGroupName
607  && pEntry->GetEntryName() == rEntryName
608  )
609  {
610  xReturn = pEntry;
611  break;
612  }
613 
614  ++aSearch;
615  }
616 
617  if ( !xReturn.is() )
618  {
619  xReturn = new SwXAutoTextEntry( this, rGroupName, rEntryName );
620  // cache it
621  m_aGlossaryEntries.emplace_back( xReturn );
622  }
623 
624  return xReturn;
625 }
626 
627 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const ::utl::TransliterationWrapper & GetAppCmpStrIgnore()
Definition: init.cxx:792
SVL_DLLPUBLIC bool IsDocument(const OUString &rURL)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoatxt.cxx:676
sal_Int32 nIndex
static OUString lcl_makePath(const std::vector< OUString > &rPaths)
Definition: glosdoc.cxx:333
std::vector< OUString > m_aInvalidPaths
Definition: glosdoc.hxx:49
aBuf
size_t GetGroupCnt()
Definition: glosdoc.cxx:97
std::unique_ptr< SwTextBlocks > GetGroupDoc(const OUString &rName, bool bCreate=false)
Definition: glosdoc.cxx:157
static OUString GetExtension()
Definition: glosdoc.cxx:418
bool UCB_DeleteFile(const OUString &rURL)
Definition: swunohelper.cxx:58
SAL_DLLPRIVATE void RemoveFileFromList(const OUString &rGroup)
Definition: glosdoc.cxx:423
SVL_DLLPUBLIC bool IsFolder(const OUString &rURL)
bool FindGroupName(OUString &rGroup)
Definition: glosdoc.cxx:103
OUString GetCompleteGroupName(const OUString &GroupName)
Definition: glosdoc.cxx:475
OUString GetBase() const
sal_uInt16 sal_Unicode
bool UCB_MoveFile(const OUString &rURL, const OUString &rNewURL)
Definition: swunohelper.cxx:77
int nCount
std::vector< OUString > m_GlosArr
Definition: glosdoc.hxx:51
bool UCB_IsCaseSensitiveFileName(const OUString &rURL)
bool DelGroupDoc(const OUString &)
Definition: glosdoc.cxx:246
const char * sName
void ShowError()
Definition: glosdoc.cxx:411
SAL_DLLPRIVATE void InvalidateUNOOjects()
Definition: glosdoc.cxx:499
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
UnoAutoTextGroups m_aGlossaryGroups
Definition: glosdoc.hxx:45
SAL_DLLPRIVATE std::unique_ptr< SwTextBlocks > GetGlosDoc(const OUString &rName, bool bCreate=true) const
Definition: glosdoc.cxx:269
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
int i
static OUString GetDefName()
Definition: glosdoc.cxx:90
UnoAutoTextEntries m_aGlossaryEntries
Definition: glosdoc.hxx:46
#define ERR_AUTOPATH_ERROR
Definition: swerror.h:35
css::uno::Reference< css::text::XAutoTextGroup > GetAutoTextGroup(const OUString &_rGroupName)
returns the cached AutoTextGroup (if any) for the given group name The group is created if it does no...
Definition: glosdoc.cxx:522
bool m_bError
Definition: glosdoc.hxx:52
std::vector< css::uno::WeakReference< css::text::XAutoTextGroup > > UnoAutoTextGroups
Definition: glosdoc.hxx:38
void UpdateGlosPath(bool bFull)
Definition: glosdoc.cxx:347
#define SVT_SEARCHPATH_DELIMITER
css::uno::Reference< css::text::XAutoTextEntry > GetAutoTextEntry(const OUString &_rCompleteGroupName, const OUString &_rGroupName, const OUString &_rEntryName)
returns the cached AutoTextEntry (if any) for the given group/with the given name The entry is create...
Definition: glosdoc.cxx:572
OUString const & GetGroupName(size_t)
Definition: glosdoc.cxx:135
OUString GetGroupTitle(const OUString &rGroupName)
Definition: glosdoc.cxx:142
bool RenameGroupDoc(const OUString &sOldGroup, OUString &sNewGroup, const OUString &rNewTitle)
Definition: glosdoc.cxx:194
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:253
OUString aName
bool UCB_GetFileListOfFolder(const OUString &rURL, std::vector< OUString > &rList, const OUString *pExtension, std::vector< ::DateTime > *pDateTimeList)
std::vector< OUString > m_PathArr
Definition: glosdoc.hxx:50
const OUString & GetAutoTextPath() const
#define GLOS_DELIM
Definition: glosdoc.hxx:41
SAL_DLLPRIVATE std::vector< OUString > & GetNameList()
Definition: glosdoc.cxx:301
std::vector< css::uno::WeakReference< css::text::XAutoTextEntry > > UnoAutoTextEntries
Definition: glosdoc.hxx:39
OUString m_aPath
Definition: glosdoc.hxx:48
bool NewGroupDoc(OUString &rGroupName, const OUString &rTitle)
Definition: glosdoc.cxx:174
OUString GetFull() const
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)