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