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