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>
23 
25 
26 #include <vcl/errinf.hxx>
27 #include <osl/diagnose.h>
28 #include <rtl/character.hxx>
29 #include <svl/urihelper.hxx>
30 #include <svl/fstathelper.hxx>
31 #include <unotools/pathoptions.hxx>
32 #include <unotools/tempfile.hxx>
33 #include <swtypes.hxx>
34 #include <uitool.hxx>
35 #include <glosdoc.hxx>
36 #include <shellio.hxx>
37 #include <swunohelper.hxx>
38 
39 #include <unoatxt.hxx>
40 #include <swerror.h>
41 #include <globals.hrc>
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(const OUString& sPath, const OUString& sName)
52 {
53  return 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 OUString("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 = static_cast<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  + OUStringLiteral1(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 = static_cast<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 = static_cast<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 + OUStringLiteral1(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  std::unique_ptr<SwTextBlocks> pNewBlock(new SwTextBlocks( sNewFileURL ));
241  pNewBlock->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 = static_cast<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 + OUStringLiteral1(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 = static_cast<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.copy( 0, aTitle.getLength() - sExt.getLength() )
315  + OUStringLiteral1(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() + OUStringLiteral1(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.getStr();
346 }
347 
349 {
350  SvtPathOptions aPathOpt;
351  const OUString& aNewPath( aPathOpt.GetAutoTextPath() );
352  bool bPathChanged = m_aPath != aNewPath;
353  if (bFull || bPathChanged)
354  {
355  m_aPath = aNewPath;
356 
357  m_PathArr.clear();
358 
359  std::vector<OUString> aDirArr;
360  std::vector<OUString> aInvalidPaths;
361  if (!m_aPath.isEmpty())
362  {
363  sal_Int32 nIndex = 0;
364  do
365  {
366  const OUString sPth = URIHelper::SmartRel2Abs(
367  INetURLObject(),
368  m_aPath.getToken(0, SVT_SEARCHPATH_DELIMITER, nIndex),
370  if (!aDirArr.empty() &&
371  std::find(aDirArr.begin(), aDirArr.end(), sPth) != aDirArr.end())
372  {
373  continue;
374  }
375  aDirArr.push_back(sPth);
376  if( !FStatHelper::IsFolder( sPth ) )
377  aInvalidPaths.push_back(sPth);
378  else
379  m_PathArr.push_back(sPth);
380  }
381  while (nIndex>=0);
382  }
383 
384  if (m_aPath.isEmpty() || !aInvalidPaths.empty())
385  {
386  std::sort(aInvalidPaths.begin(), aInvalidPaths.end());
387  aInvalidPaths.erase(std::unique(aInvalidPaths.begin(), aInvalidPaths.end()), aInvalidPaths.end());
388  if (bPathChanged || (m_aInvalidPaths != aInvalidPaths))
389  {
390  m_aInvalidPaths = aInvalidPaths;
391  // wrong path, that means AutoText directory doesn't exist
392 
395  DialogMask::ButtonsOk | DialogMask::MessageError ) );
396  m_bError = true;
397  }
398  else
399  m_bError = false;
400  }
401  else
402  m_bError = false;
403 
404  if (!m_GlosArr.empty())
405  {
406  m_GlosArr.clear();
407  GetNameList();
408  }
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 OUString(".bau");
422 }
423 
424 void SwGlossaries::RemoveFileFromList( const OUString& rGroup )
425 {
426  if (!m_GlosArr.empty())
427  {
428  auto it = std::find(m_GlosArr.begin(), m_GlosArr.end(), rGroup);
429  if (it != m_GlosArr.end())
430  {
431  {
432  // tell the UNO AutoTextGroup object that it's not valid anymore
433  for ( UnoAutoTextGroups::iterator aLoop = m_aGlossaryGroups.begin();
434  aLoop != m_aGlossaryGroups.end();
435  )
436  {
437  Reference< container::XNamed > xNamed( aLoop->get(), UNO_QUERY );
438  if ( !xNamed.is() )
439  {
440  aLoop = m_aGlossaryGroups.erase(aLoop);
441  }
442  else if ( xNamed->getName() == rGroup )
443  {
444  static_cast< SwXAutoTextGroup* >( xNamed.get() )->Invalidate();
445  // note that this static_cast works because we know that the array only
446  // contains SwXAutoTextGroup implementation
447  m_aGlossaryGroups.erase( aLoop );
448  break;
449  } else
450  ++aLoop;
451  }
452  }
453 
454  {
455  // tell all our UNO AutoTextEntry objects that they're not valid anymore
456  for ( UnoAutoTextEntries::iterator aLoop = m_aGlossaryEntries.begin();
457  aLoop != m_aGlossaryEntries.end();
458  )
459  {
460  Reference< lang::XUnoTunnel > xEntryTunnel( aLoop->get(), UNO_QUERY );
461 
462  SwXAutoTextEntry* pEntry = nullptr;
463  if ( xEntryTunnel.is() )
464  pEntry = reinterpret_cast< SwXAutoTextEntry* >(
465  xEntryTunnel->getSomething( SwXAutoTextEntry::getUnoTunnelId() ) );
466 
467  if ( pEntry && ( pEntry->GetGroupName() == rGroup ) )
468  {
469  pEntry->Invalidate();
470  aLoop = m_aGlossaryEntries.erase( aLoop );
471  }
472  else
473  ++aLoop;
474  }
475  }
476 
477  m_GlosArr.erase(it);
478  }
479  }
480 }
481 
482 OUString SwGlossaries::GetCompleteGroupName( const OUString& rGroupName )
483 {
484  const size_t nCount = GetGroupCnt();
485  // when the group name was created internally the path is here as well
486  sal_Int32 nIndex = 0;
487  const OUString sGroupName(rGroupName.getToken(0, GLOS_DELIM, nIndex));
488  const bool bPathLen = !rGroupName.getToken(0, GLOS_DELIM, nIndex).isEmpty();
489  for ( size_t i = 0; i < nCount; i++ )
490  {
491  const OUString sGrpName = GetGroupName(i);
492  if (bPathLen)
493  {
494  if (rGroupName == sGrpName)
495  return sGrpName;
496  }
497  else
498  {
499  if (sGroupName == sGrpName.getToken(0, GLOS_DELIM))
500  return sGrpName;
501  }
502  }
503  return OUString();
504 }
505 
507 {
508  // invalidate all the AutoTextGroup-objects
509  for (const auto& rGroup : m_aGlossaryGroups)
510  {
511  Reference< text::XAutoTextGroup > xGroup( rGroup.get(), UNO_QUERY );
512  if ( xGroup.is() )
513  static_cast< SwXAutoTextGroup* >( xGroup.get() )->Invalidate();
514  }
516  m_aGlossaryGroups.swap( aTmpg );
517 
518  // invalidate all the AutoTextEntry-objects
519  for (const auto& rEntry : m_aGlossaryEntries)
520  {
521  Reference< lang::XUnoTunnel > xEntryTunnel( rEntry.get(), UNO_QUERY );
522  SwXAutoTextEntry* pEntry = nullptr;
523  if ( xEntryTunnel.is() )
524  pEntry = reinterpret_cast< SwXAutoTextEntry* >(
525  xEntryTunnel->getSomething( SwXAutoTextEntry::getUnoTunnelId() ) );
526 
527  if ( pEntry )
528  pEntry->Invalidate();
529  }
531  m_aGlossaryEntries.swap( aTmpe );
532 }
533 
534 Reference< text::XAutoTextGroup > SwGlossaries::GetAutoTextGroup( const OUString& _rGroupName )
535 {
536  bool _bCreate = true;
537  // first, find the name with path-extension
538  const OUString sCompleteGroupName = GetCompleteGroupName( _rGroupName );
539 
540  Reference< text::XAutoTextGroup > xGroup;
541 
542  // look up the group in the cache
543  UnoAutoTextGroups::iterator aSearch = m_aGlossaryGroups.begin();
544  for ( ; aSearch != m_aGlossaryGroups.end(); )
545  {
546  Reference< lang::XUnoTunnel > xGroupTunnel( aSearch->get(), UNO_QUERY );
547 
548  SwXAutoTextGroup* pSwGroup = nullptr;
549  if ( xGroupTunnel.is() )
550  pSwGroup = reinterpret_cast< SwXAutoTextGroup* >( xGroupTunnel->getSomething( SwXAutoTextGroup::getUnoTunnelId() ) );
551 
552  if ( !pSwGroup )
553  {
554  // the object is dead in the meantime -> remove from cache
555  aSearch = m_aGlossaryGroups.erase( aSearch );
556  continue;
557  }
558 
559  if ( _rGroupName == pSwGroup->getName() )
560  { // the group is already cached
561  if ( !sCompleteGroupName.isEmpty() )
562  { // the group still exists -> return it
563  xGroup = pSwGroup;
564  break;
565  }
566  else
567  {
568  // this group does not exist (anymore) -> release the cached UNO object for it
569  aSearch = m_aGlossaryGroups.erase( aSearch );
570  // so it won't be created below
571  _bCreate = false;
572  break;
573  }
574  }
575 
576  ++aSearch;
577  }
578 
579  if ( !xGroup.is() && _bCreate )
580  {
581  xGroup = new SwXAutoTextGroup( sCompleteGroupName, this );
582  // cache it
583  m_aGlossaryGroups.emplace_back( xGroup );
584  }
585 
586  return xGroup;
587 }
588 
589 Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry(
590  const OUString& rCompleteGroupName,
591  const OUString& rGroupName,
592  const OUString& rEntryName )
593 {
594  //standard must be created
595  bool bCreate = ( rCompleteGroupName == GetDefName() );
596  std::unique_ptr< SwTextBlocks > pGlosGroup( GetGroupDoc( rCompleteGroupName, bCreate ) );
597 
598  if (!pGlosGroup || pGlosGroup->GetError())
599  throw lang::WrappedTargetException();
600 
601  sal_uInt16 nIdx = pGlosGroup->GetIndex( rEntryName );
602  if ( USHRT_MAX == nIdx )
603  throw container::NoSuchElementException();
604 
605  Reference< text::XAutoTextEntry > xReturn;
606 
607  UnoAutoTextEntries::iterator aSearch( m_aGlossaryEntries.begin() );
608  for ( ; aSearch != m_aGlossaryEntries.end(); )
609  {
610  Reference< lang::XUnoTunnel > xEntryTunnel( aSearch->get(), UNO_QUERY );
611 
612  SwXAutoTextEntry* pEntry = nullptr;
613  if ( xEntryTunnel.is() )
614  pEntry = reinterpret_cast< SwXAutoTextEntry* >( xEntryTunnel->getSomething( SwXAutoTextEntry::getUnoTunnelId() ) );
615  else
616  {
617  // the object is dead in the meantime -> remove from cache
618  aSearch = m_aGlossaryEntries.erase( aSearch );
619  continue;
620  }
621 
622  if ( pEntry
623  && pEntry->GetGroupName() == rGroupName
624  && pEntry->GetEntryName() == rEntryName
625  )
626  {
627  xReturn = pEntry;
628  break;
629  }
630 
631  ++aSearch;
632  }
633 
634  if ( !xReturn.is() )
635  {
636  xReturn = new SwXAutoTextEntry( this, rGroupName, rEntryName );
637  // cache it
638  m_aGlossaryEntries.emplace_back( xReturn );
639  }
640 
641  return xReturn;
642 }
643 
644 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const ::utl::TransliterationWrapper & GetAppCmpStrIgnore()
Definition: init.cxx:823
SVL_DLLPUBLIC bool IsDocument(const OUString &rURL)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoatxt.cxx:687
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:58
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:482
OUString GetBase() const
sal_uInt16 sal_Unicode
bool UCB_MoveFile(const OUString &rURL, const OUString &rNewURL)
Definition: swunohelper.cxx:77
std::vector< OUString > m_GlosArr
Definition: glosdoc.hxx:51
bool UCB_IsCaseSensitiveFileName(const OUString &rURL)
bool DelGroupDoc(const OUString &)
Definition: glosdoc.cxx:247
void ShowError()
Definition: glosdoc.cxx:412
SAL_DLLPRIVATE void InvalidateUNOOjects()
Definition: glosdoc.cxx:506
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)
OUString sName
int i
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:534
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
void Invalidate()
Definition: unoatxt.hxx:236
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:589
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
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:259
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
OString const aName
std::vector< css::uno::WeakReference< css::text::XAutoTextEntry > > UnoAutoTextEntries
Definition: glosdoc.hxx:39
OUString m_aPath
Definition: glosdoc.hxx:48
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoatxt.cxx:220
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)