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 <uitool.hxx>
36 #include <glosdoc.hxx>
37 #include <shellio.hxx>
38 #include <swunohelper.hxx>
39 
40 #include <unoatxt.hxx>
41 #include <swerror.h>
42 #include <globals.hrc>
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(const OUString& sPath, const OUString& sName)
53 {
54  return 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("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==sTemp.getToken(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 = sTemp.getToken(1, GLOS_DELIM).toUInt32();
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 OUString sNewPath(rGroupName.getToken(1, GLOS_DELIM));
179  sal_uInt16 nNewPath = static_cast<sal_uInt16>(sNewPath.toInt32());
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 = static_cast<sal_uInt16>(rOldGroup.getToken(1, GLOS_DELIM).toInt32());
200  if (static_cast<size_t>(nOldPath) >= m_PathArr.size())
201  return false;
202 
203  const OUString sOldFileURL =
204  lcl_FullPathName(m_PathArr[nOldPath], rOldGroup.getToken(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 = static_cast<sal_uInt16>(rNewGroup.getToken(1, GLOS_DELIM).toInt32());
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  std::unique_ptr<SwTextBlocks> pNewBlock(new SwTextBlocks( sNewFileURL ));
242  pNewBlock->SetName(rNewTitle);
243 
244  return true;
245 }
246 
247 // Deletes a text block group
248 bool SwGlossaries::DelGroupDoc(const OUString &rName)
249 {
250  sal_uInt16 nPath = static_cast<sal_uInt16>(rName.getToken(1, GLOS_DELIM).toInt32());
251  if (static_cast<size_t>(nPath) >= m_PathArr.size())
252  return false;
253  const OUString sBaseName(rName.getToken(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 = static_cast<sal_uInt16>(rName.getToken(1, GLOS_DELIM).toInt32());
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], rName.getToken(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.copy( 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.getStr();
347 }
348 
350 {
351  SvtPathOptions aPathOpt;
352  const OUString& aNewPath( aPathOpt.GetAutoTextPath() );
353  bool bPathChanged = m_aPath != aNewPath;
354  if (bFull || bPathChanged)
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 }
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  {
429  auto it = std::find(m_GlosArr.begin(), m_GlosArr.end(), rGroup);
430  if (it != m_GlosArr.end())
431  {
432  {
433  // tell the UNO AutoTextGroup object that it's not valid anymore
434  for ( UnoAutoTextGroups::iterator aLoop = m_aGlossaryGroups.begin();
435  aLoop != m_aGlossaryGroups.end();
436  )
437  {
438  Reference< container::XNamed > xNamed( aLoop->get(), UNO_QUERY );
439  if ( !xNamed.is() )
440  {
441  aLoop = m_aGlossaryGroups.erase(aLoop);
442  }
443  else if ( xNamed->getName() == rGroup )
444  {
445  static_cast< SwXAutoTextGroup* >( xNamed.get() )->Invalidate();
446  // note that this static_cast works because we know that the array only
447  // contains SwXAutoTextGroup implementation
448  m_aGlossaryGroups.erase( aLoop );
449  break;
450  } else
451  ++aLoop;
452  }
453  }
454 
455  {
456  // tell all our UNO AutoTextEntry objects that they're not valid anymore
457  for ( UnoAutoTextEntries::iterator aLoop = m_aGlossaryEntries.begin();
458  aLoop != m_aGlossaryEntries.end();
459  )
460  {
461  auto pEntry = comphelper::getUnoTunnelImplementation<SwXAutoTextEntry>(aLoop->get());
462  if ( pEntry && ( pEntry->GetGroupName() == rGroup ) )
463  {
464  pEntry->Invalidate();
465  aLoop = m_aGlossaryEntries.erase( aLoop );
466  }
467  else
468  ++aLoop;
469  }
470  }
471 
472  m_GlosArr.erase(it);
473  }
474  }
475 }
476 
477 OUString SwGlossaries::GetCompleteGroupName( const OUString& 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 OUString sGroupName(rGroupName.getToken(0, GLOS_DELIM, nIndex));
483  const bool bPathLen = !rGroupName.getToken(0, GLOS_DELIM, nIndex).isEmpty();
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 == sGrpName.getToken(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 aTmpg;
511  m_aGlossaryGroups.swap( aTmpg );
512 
513  // invalidate all the AutoTextEntry-objects
514  for (const auto& rEntry : m_aGlossaryEntries)
515  {
516  auto pEntry = comphelper::getUnoTunnelImplementation<SwXAutoTextEntry>(rEntry.get());
517  if ( pEntry )
518  pEntry->Invalidate();
519  }
520  UnoAutoTextEntries aTmpe;
521  m_aGlossaryEntries.swap( aTmpe );
522 }
523 
524 Reference< text::XAutoTextGroup > SwGlossaries::GetAutoTextGroup( const OUString& _rGroupName )
525 {
526  bool _bCreate = true;
527  // first, find the name with path-extension
528  const OUString sCompleteGroupName = GetCompleteGroupName( _rGroupName );
529 
530  Reference< text::XAutoTextGroup > xGroup;
531 
532  // look up the group in the cache
533  UnoAutoTextGroups::iterator aSearch = m_aGlossaryGroups.begin();
534  for ( ; aSearch != m_aGlossaryGroups.end(); )
535  {
536  auto pSwGroup = comphelper::getUnoTunnelImplementation<SwXAutoTextGroup>(aSearch->get());
537  if ( !pSwGroup )
538  {
539  // the object is dead in the meantime -> remove from cache
540  aSearch = m_aGlossaryGroups.erase( aSearch );
541  continue;
542  }
543 
544  if ( _rGroupName == pSwGroup->getName() )
545  { // the group is already cached
546  if ( !sCompleteGroupName.isEmpty() )
547  { // the group still exists -> return it
548  xGroup = pSwGroup;
549  break;
550  }
551  else
552  {
553  // this group does not exist (anymore) -> release the cached UNO object for it
554  aSearch = m_aGlossaryGroups.erase( aSearch );
555  // so it won't be created below
556  _bCreate = false;
557  break;
558  }
559  }
560 
561  ++aSearch;
562  }
563 
564  if ( !xGroup.is() && _bCreate )
565  {
566  xGroup = new SwXAutoTextGroup( sCompleteGroupName, this );
567  // cache it
568  m_aGlossaryGroups.emplace_back( xGroup );
569  }
570 
571  return xGroup;
572 }
573 
574 Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry(
575  const OUString& rCompleteGroupName,
576  const OUString& rGroupName,
577  const OUString& rEntryName )
578 {
579  //standard must be created
580  bool bCreate = ( rCompleteGroupName == GetDefName() );
581  std::unique_ptr< SwTextBlocks > pGlosGroup( GetGroupDoc( rCompleteGroupName, bCreate ) );
582 
583  if (!pGlosGroup || pGlosGroup->GetError())
584  throw lang::WrappedTargetException();
585 
586  sal_uInt16 nIdx = pGlosGroup->GetIndex( rEntryName );
587  if ( USHRT_MAX == nIdx )
588  throw container::NoSuchElementException();
589 
590  Reference< text::XAutoTextEntry > xReturn;
591 
592  UnoAutoTextEntries::iterator aSearch( m_aGlossaryEntries.begin() );
593  for ( ; aSearch != m_aGlossaryEntries.end(); )
594  {
595  Reference< lang::XUnoTunnel > xEntryTunnel( aSearch->get(), UNO_QUERY );
596 
597  SwXAutoTextEntry* pEntry = nullptr;
598  if ( xEntryTunnel.is() )
599  pEntry = reinterpret_cast< SwXAutoTextEntry* >( xEntryTunnel->getSomething( SwXAutoTextEntry::getUnoTunnelId() ) );
600  else
601  {
602  // the object is dead in the meantime -> remove from cache
603  aSearch = m_aGlossaryEntries.erase( aSearch );
604  continue;
605  }
606 
607  if ( pEntry
608  && pEntry->GetGroupName() == rGroupName
609  && pEntry->GetEntryName() == rEntryName
610  )
611  {
612  xReturn = pEntry;
613  break;
614  }
615 
616  ++aSearch;
617  }
618 
619  if ( !xReturn.is() )
620  {
621  xReturn = new SwXAutoTextEntry( this, rGroupName, rEntryName );
622  // cache it
623  m_aGlossaryEntries.emplace_back( xReturn );
624  }
625 
626  return xReturn;
627 }
628 
629 /* 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:683
sal_Int32 nIndex
static OUString lcl_makePath(const std::vector< OUString > &rPaths)
Definition: glosdoc.cxx:335
std::vector< OUString > m_aInvalidPaths
Definition: glosdoc.hxx:49
aBuf
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 GetCompleteGroupName(const OUString &GroupName)
Definition: glosdoc.cxx:477
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:248
const char * sName
void ShowError()
Definition: glosdoc.cxx:413
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)
int i
static OUString GetDefName()
Definition: glosdoc.cxx:92
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:524
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:574
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
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
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:303
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
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)