22 #include <osl/diagnose.h>
42 const sal_Int32 nLen = std::min(r.getLength(),
static_cast<sal_Int32
>(8));
43 for (sal_Int32
i=0;
i<nLen; ++
i)
45 n = ( n << 1 ) + r[
i];
51 : m_aShort( rShort ), m_aLong( rLong ), m_aPackageName (rShort),
52 m_bIsOnlyTextFlagInit( false ), m_bIsOnlyText( false )
59 : m_aShort( rShort ), m_aLong( rLong ), m_aPackageName (rPackageName),
60 m_bIsOnlyTextFlagInit( false ), m_bIsOnlyText( false )
111 std::unique_ptr<SwPaM> pPam(
new SwPaM(
m_xDoc->GetNodes().GetEndOfContent() ));
130 const sal_uInt16 nHash =
Hash( s );
143 sal_uInt16 nHash =
Hash( rLong );
178 sal_uInt16 nIdx =
GetIndex( rShort );
183 std::unique_ptr<SwBlockName> pNew(
new SwBlockName( rShort, rLong ));
184 pNew->m_bIsOnlyTextFlagInit =
true;
185 pNew->m_bIsOnlyText = bOnlyText;
273 return m_pImp->GetShortName( n );
280 return m_pImp->GetLongName( n );
288 if(
m_pImp->IsFileChanged() )
297 if( n ==
m_pImp->m_nCurrentIndex )
324 OSL_ENSURE(
false,
"No short name provided in the rename" );
329 if(
m_pImp->IsFileChanged() )
338 bool bOnlyText =
m_pImp->m_aNames[ n ]->m_bIsOnlyText;
340 m_pImp->AddName( aNew, aLong, bOnlyText );
352 if(
m_pImp->IsFileChanged() )
361 m_pImp->m_nCurrentIndex = n;
378 bool bOk =
m_pImp->m_bInPutMuchBlocks;
381 if(
m_pImp->IsFileChanged() )
414 if( !
m_pImp->m_bInPutMuchBlocks )
417 if( !
m_pImp->m_bInPutMuchBlocks )
422 nIdx =
m_pImp->m_nCurrentIndex;
428 const OUString& rText )
433 bool bOk =
m_pImp->m_bInPutMuchBlocks;
436 if(
m_pImp->IsFileChanged() )
451 m_pImp->m_aNames[ nIdx ]->m_aLong = rName;
457 if( !
m_pImp->m_bInPutMuchBlocks )
461 if( !
m_pImp->m_bInPutMuchBlocks )
473 return m_pImp->m_xDoc.get();
488 return m_pImp->GetFileName();
493 return m_pImp->m_bReadOnly;
516 sal_uInt16 nIdx =
m_pImp->GetIndex( rShort );
519 if(
m_pImp->m_aNames[ nIdx ]->m_bIsOnlyTextFlagInit )
520 return m_pImp->m_aNames[ nIdx ]->m_bIsOnlyText;
524 OSL_ENSURE(
false,
"Invalid name" );
548 bRet =
m_pImp->PutMuchEntries(
true );
555 m_pImp->PutMuchEntries(
false );
561 return m_pImp->GetBaseURL();
virtual void ClearDoc()
Delete the document's content.
SVL_DLLPUBLIC bool IsDocument(const OUString &rURL)
bool IsOnlyTextBlock(sal_uInt16) const
void SetName(const OUString &)
virtual void AddName(const OUString &, const OUString &, bool bOnlyText=false)
rtl::Reference< SwDoc > m_xDoc
sal_uInt16 GetIndex(const OUString &) const
Get count of Text Blocks.
OUString GetLongName(sal_uInt16) const
bool m_bIsOnlyTextFlagInit
Package name.
void Rename(sal_uInt16, const OUString *, const OUString *)
virtual ErrCode SetMacroTable(sal_uInt16 nIdx, const SvxMacroTableDtor &rMacroTable)
tools::Time m_aTimeModified
bool setExtension(OUString const &rTheExtension, sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
SwBlockName(const OUString &rShort, const OUString &rLong)
Unformatted text.
sal_uInt16 GetCount() const
Hashcode for Block names.
SwImpBlocks(const OUString &)
bool BeginGetDoc(sal_uInt16)
bool IsFileChanged() const
virtual bool IsOnlyTextBlock(const OUString &rShort) const
virtual ErrCode GetMacroTable(sal_uInt16 nIdx, SvxMacroTableDtor &rMacroTable)
PaM is Point and Mark: a selection of the document model.
#define ERR_TXTBLOCK_NEWFILE_ERROR
void SetBaseURL(const OUString &rURL)
sal_uInt16 PutText(const OUString &, const OUString &, const OUString &)
sal_uInt16 GetLongIndex(const OUString &) const
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
sal_uInt16 GetLongIndex(const OUString &) const
Index for shortnames.
void EndPutMuchBlockEntries()
bool GoInDoc(SwPaM &rPam, SwMoveFnCollection const &fnMove)
static FileType GetFileType(const OUString &)
Is the provided file a storage or doesn't it exist?
SwTextBlocks(const OUString &)
OUString GetShortName(sal_uInt16) const
Index for longnames.
OUString GetLongName(sal_uInt16) const
Return shortname for index.
sal_uInt16 GetCount() const
const_iterator begin() const
std::unique_ptr< SwPaM > MakePaM()
Creating a PaM, that spans the whole document.
bool BeginPutDoc(const OUString &, const OUString &)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
OUString GetBaseURL() const
bool GetMacroTable(sal_uInt16 nIdx, SvxMacroTableDtor &rMacroTable)
bool m_bIsOnlyText
Is the Flag valid?
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
sal_uInt16 GetIndex(const OUString &) const
#define ERR_SWG_INTERNAL_ERROR
std::unique_ptr< SwImpBlocks > m_pImp
SVL_DLLPUBLIC bool GetModifiedDateTimeOfFile(const OUString &rURL, Date *pDate, tools::Time *pTime)
SwMoveFnCollection const & fnMoveBackward
OUString GetPackageName(sal_uInt16) const
Return longname for index.
OUString GetShortName(sal_uInt16) const
bool SetMacroTable(sal_uInt16 nIdx, const SvxMacroTableDtor &rMacroTable)
std::pair< const_iterator, bool > insert(Value &&x)
virtual bool PutMuchEntries(bool bOn)
OUString m_aLong
Shortname.
CharClass & GetAppCharClass()
bool StartPutMuchBlockEntries()
static bool IsFileUCBStorage(const OUString &rFileName)
#define ERR_SWG_FILE_FORMAT_ERROR
OUString const & GetFileName() const
static sal_uInt16 Hash(const OUString &)
Calculate hash code (is not guaranteed to be unique)
size_type erase(const Value &x)