|
LibreOffice Module sw (master) 1
|
#include <SwXMLTextBlocks.hxx>
Public Member Functions | |
| SwXMLTextBlocks (const OUString &rFile) | |
| SwXMLTextBlocks (const css::uno::Reference< css::embed::XStorage > &, const OUString &rFile) | |
| void | AddName (const OUString &, const OUString &, const OUString &, bool bOnlyText) |
| virtual void | AddName (const OUString &, const OUString &, bool bOnlyText=false) override |
| virtual | ~SwXMLTextBlocks () override |
| virtual ErrCode | Delete (sal_uInt16) override |
| virtual ErrCode | Rename (sal_uInt16, const OUString &) override |
| virtual ErrCode | CopyBlock (SwImpBlocks &rImp, OUString &rShort, const OUString &rLong) override |
| virtual void | ClearDoc () override |
| Delete the document's content. More... | |
| virtual ErrCode | GetDoc (sal_uInt16) override |
| virtual ErrCode | BeginPutDoc (const OUString &, const OUString &) override |
| virtual ErrCode | PutDoc () override |
| virtual ErrCode | PutText (const OUString &, const OUString &, const OUString &) override |
| virtual ErrCode | MakeBlockList () override |
| virtual ErrCode | OpenFile (bool bReadOnly=true) override |
| virtual void | CloseFile () override |
| ErrCode | GetText (std::u16string_view rShort, OUString &) |
| virtual bool | IsOnlyTextBlock (const OUString &rShort) const override |
| bool | IsOnlyTextBlock (sal_uInt16 nIdx) const |
| void | SetIsTextOnly (const OUString &rShort, bool bNewValue) |
| virtual ErrCode | GetMacroTable (sal_uInt16, SvxMacroTableDtor &rMacroTable) override |
| virtual ErrCode | SetMacroTable (sal_uInt16 nIdx, const SvxMacroTableDtor &rMacroTable) override |
| virtual bool | PutMuchEntries (bool bOn) override |
| SwDoc * | GetDoc () const |
| ErrCode | StartPutBlock (const OUString &rShort, const OUString &rPackageName) |
| ErrCode | PutBlock () |
| ErrCode | GetBlockText (std::u16string_view rShort, OUString &rText) |
| ErrCode | PutBlockText (const OUString &rShort, std::u16string_view rText, const OUString &rPackageName) |
| void | MakeBlockText (std::u16string_view rText) |
Public Member Functions inherited from SwImpBlocks | |
| virtual | ~SwImpBlocks () |
| sal_uInt16 | GetCount () const |
| Hashcode for Block names. More... | |
| sal_uInt16 | GetIndex (const OUString &) const |
| Get count of Text Blocks. More... | |
| sal_uInt16 | GetLongIndex (std::u16string_view) const |
| Index for shortnames. More... | |
| OUString | GetShortName (sal_uInt16) const |
| Index for longnames. More... | |
| OUString | GetLongName (sal_uInt16) const |
| Return shortname for index. More... | |
| OUString | GetPackageName (sal_uInt16) const |
| Return longname for index. More... | |
| const OUString & | GetFileName () const |
| Return packagename for index. More... | |
| void | SetName (const OUString &rName) |
| Return physical file name. More... | |
| const OUString & | GetName () const |
| const OUString & | GetBaseURL () const |
| void | SetBaseURL (const OUString &rURL) |
| virtual ErrCode | Delete (sal_uInt16)=0 |
| virtual ErrCode | Rename (sal_uInt16, const OUString &)=0 |
| virtual ErrCode | CopyBlock (SwImpBlocks &rImp, OUString &rShort, const OUString &rLong)=0 |
| virtual ErrCode | GetDoc (sal_uInt16)=0 |
| virtual ErrCode | BeginPutDoc (const OUString &, const OUString &)=0 |
| virtual ErrCode | PutDoc ()=0 |
| virtual ErrCode | PutText (const OUString &, const OUString &, const OUString &)=0 |
| virtual ErrCode | MakeBlockList ()=0 |
| virtual ErrCode | OpenFile (bool bReadOnly=true)=0 |
| virtual void | CloseFile ()=0 |
| virtual bool | IsOnlyTextBlock (const OUString &rShort) const |
| virtual ErrCode | GetMacroTable (sal_uInt16 nIdx, SvxMacroTableDtor &rMacroTable) |
| virtual ErrCode | SetMacroTable (sal_uInt16 nIdx, const SvxMacroTableDtor &rMacroTable) |
| virtual bool | PutMuchEntries (bool bOn) |
Static Public Member Functions | |
| static OUString | GeneratePackageName (std::u16string_view rShort) |
| static bool | IsFileUCBStorage (const OUString &rFileName) |
Static Public Member Functions inherited from SwImpBlocks | |
| static sal_uInt16 | Hash (std::u16string_view) |
| Calculate hash code (is not guaranteed to be unique) More... | |
Private Member Functions | |
| void | ReadInfo () |
| void | WriteInfo () |
| void | InitBlockMode (const css::uno::Reference< css::embed::XStorage > &rStorage) |
| void | ResetBlockMode () |
Private Attributes | |
| SfxObjectShellRef | m_xDocShellRef |
| SwXmlFlags | m_nFlags |
| OUString | m_aPackageName |
| tools::SvRef< SfxMedium > | m_xMedium |
| css::uno::Reference< css::embed::XStorage > | m_xBlkRoot |
| css::uno::Reference< css::embed::XStorage > | m_xRoot |
Additional Inherited Members | |
Protected Types inherited from SwImpBlocks | |
| enum class | FileType { NoFile , None , XML } |
Protected Member Functions inherited from SwImpBlocks | |
| SwImpBlocks (const OUString &) | |
| virtual void | ClearDoc () |
| Delete the document's content. More... | |
| std::unique_ptr< SwPaM > | MakePaM () |
| Creating a PaM, that spans the whole document. More... | |
| virtual void | AddName (const OUString &, const OUString &, bool bOnlyText=false) |
| bool | IsFileChanged () const |
| void | Touch () |
Static Protected Member Functions inherited from SwImpBlocks | |
| static FileType | GetFileType (const OUString &) |
| Is the provided file a storage or doesn't it exist? More... | |
Protected Attributes inherited from SwImpBlocks | |
| OUString | m_aFile |
| OUString | m_aName |
| OUString | m_aCurrentText |
| OUString | m_aShort |
| OUString | m_aLong |
| OUString | m_sBaseURL |
| SwBlockNames | m_aNames |
| Date | m_aDateModified |
| tools::Time | m_aTimeModified |
| rtl::Reference< SwDoc > | m_xDoc |
| sal_uInt16 | m_nCurrentIndex |
| bool | m_bReadOnly: 1 |
| bool | m_bInPutMuchBlocks: 1 |
| bool | m_bInfoChanged: 1 |
Definition at line 41 of file SwXMLTextBlocks.hxx.
| SwXMLTextBlocks::SwXMLTextBlocks | ( | const OUString & | rFile | ) |
Definition at line 63 of file SwXMLTextBlocks.cxx.
References SfxObjectShell::DoInitNew(), Date::GetDate(), SwDocShell::GetDoc(), comphelper::OStorageHelper::GetStorageFromURL(), tools::Time::GetTime(), InitBlockMode(), SwImpBlocks::m_aDateModified, SwImpBlocks::m_aTimeModified, SwImpBlocks::m_bInfoChanged, SwImpBlocks::m_bReadOnly, m_nFlags, SwImpBlocks::m_xDoc, m_xDocShellRef, ReadInfo(), ResetBlockMode(), TOOLS_WARN_EXCEPTION, and SwImpBlocks::Touch().
| SwXMLTextBlocks::SwXMLTextBlocks | ( | const css::uno::Reference< css::embed::XStorage > & | , |
| const OUString & | rFile | ||
| ) |
|
overridevirtual |
Definition at line 123 of file SwXMLTextBlocks.cxx.
References tools::SvRef< typename T >::is(), SwImpBlocks::m_bInfoChanged, m_xDocShellRef, ResetBlockMode(), and WriteInfo().
|
overridevirtual |
Reimplemented from SwImpBlocks.
Definition at line 143 of file SwXMLTextBlocks.cxx.
References AddName(), GeneratePackageName(), and m_aPackageName.
| void SwXMLTextBlocks::AddName | ( | const OUString & | rShort, |
| const OUString & | rLong, | ||
| const OUString & | rPackageName, | ||
| bool | bOnlyText | ||
| ) |
Definition at line 149 of file SwXMLTextBlocks.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::begin(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::erase(), SwImpBlocks::GetIndex(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), SwImpBlocks::m_aNames, and SwImpBlocks::m_bInfoChanged.
Referenced by AddName(), CopyBlock(), and SwAutoCorrect::PutText().
|
overridevirtual |
Implements SwImpBlocks.
Definition at line 308 of file SwXMLTextBlocks.cxx.
References GeneratePackageName(), SwImpBlocks::m_aLong, m_aPackageName, SwImpBlocks::m_aShort, SetIsTextOnly(), and StartPutBlock().
Referenced by SwAutoCorrect::PutText().
|
overridevirtual |
Delete the document's content.
Reimplemented from SwImpBlocks.
Definition at line 133 of file SwXMLTextBlocks.cxx.
References SfxObjectShell::ClearEmbeddedObjects(), SwDocShell::InvalidateModel(), SwImpBlocks::m_xDoc, and SwDocShell::ReactivateModel().
Referenced by PutText().
|
overridevirtual |
Implements SwImpBlocks.
Definition at line 470 of file SwXMLTextBlocks.cxx.
References SwImpBlocks::m_bInfoChanged, ResetBlockMode(), and WriteInfo().
Referenced by CopyBlock(), GetMacroTable(), PutMuchEntries(), and SetMacroTable().
|
overridevirtual |
Implements SwImpBlocks.
Definition at line 235 of file SwXMLTextBlocks.cxx.
References AddName(), CloseFile(), SwImpBlocks::CloseFile(), ERR_SWG_WRITE_ERROR, ERRCODE_NONE, SwImpBlocks::GetIndex(), SwImpBlocks::GetPackageName(), IsOnlyTextBlock(), m_xBlkRoot, MakeBlockList(), nIndex, OpenFile(), and SwImpBlocks::OpenFile().
|
overridevirtual |
Implements SwImpBlocks.
Definition at line 164 of file SwXMLTextBlocks.cxx.
References ERR_SWG_WRITE_ERROR, ERRCODE_NONE, SwImpBlocks::m_aNames, m_aPackageName, m_xBlkRoot, and n.
|
static |
Definition at line 516 of file SwXMLTextBlocks.cxx.
References aBuf, nPos, and OUStringToOString().
Referenced by AddName(), BeginPutDoc(), GetBlockText(), PutText(), and Rename().
| ErrCode SwXMLTextBlocks::GetBlockText | ( | std::u16string_view | rShort, |
| OUString & | rText | ||
| ) |
Definition at line 270 of file SwXMLTextBlocks1.cxx.
References ERRCODE_NONE, GeneratePackageName(), comphelper::getProcessComponentContext(), SwImpBlocks::m_aName, m_xBlkRoot, m_xRoot, SAL_WARN, XML_NAMESPACE_OFFICE, and XML_NAMESPACE_TEXT.
Referenced by GetText().
|
inline |
Definition at line 89 of file SwXMLTextBlocks.hxx.
References SwImpBlocks::m_xDoc.
|
overridevirtual |
Implements SwImpBlocks.
Definition at line 60 of file SwXMLTextBlocks1.cxx.
References ERRCODE_NONE, SwImpBlocks::GetBaseURL(), SwImpBlocks::GetPackageName(), comphelper::getProcessComponentContext(), IsOnlyTextBlock(), SwImpBlocks::m_aCurrentText, SwImpBlocks::m_aNames, SwImpBlocks::m_bInfoChanged, m_xBlkRoot, SwImpBlocks::m_xDoc, m_xMedium, m_xRoot, MakeBlockText(), SwReader::Read(), ReadXML, Reader::SetBlockMode(), XML_NAMESPACE_OFFICE, XML_NAMESPACE_TEXT, and xStream.
Referenced by SwAutoCorrect::PutText().
|
overridevirtual |
Reimplemented from SwImpBlocks.
Definition at line 163 of file SwXMLTextBlocks1.cxx.
References aAutotextEvents, Any, CloseFile(), ERR_SWG_READ_ERROR, ERRCODE_NONE, comphelper::getProcessComponentContext(), SotStorage::GetVersion(), SwImpBlocks::m_aLong, SwImpBlocks::m_aName, SwImpBlocks::m_aNames, m_aPackageName, SwImpBlocks::m_aShort, m_xBlkRoot, m_xRoot, OpenFile(), SOFFICE_FILEFORMAT_60, and TOOLS_WARN_EXCEPTION.
| ErrCode SwXMLTextBlocks::GetText | ( | std::u16string_view | rShort, |
| OUString & | rText | ||
| ) |
Definition at line 398 of file SwXMLTextBlocks.cxx.
References GetBlockText().
Referenced by SwAutoCorrect::PutText().
|
private |
Definition at line 51 of file SwXMLTextBlocks.cxx.
References m_xBlkRoot, and m_xRoot.
Referenced by OpenFile(), and SwXMLTextBlocks().
|
static |
Definition at line 499 of file SwXMLTextBlocks.cxx.
References aName, aURL, utl::UcbStreamHelper::CreateStream(), INetURLObject::GetMainURL(), INetURLObject::GetProtocol(), UCBStorage::IsStorageFile(), INetURLObject::NONE, and INetURLObject::SetURL().
Referenced by SwImpBlocks::GetFileType().
|
overridevirtual |
Reimplemented from SwImpBlocks.
Definition at line 484 of file SwXMLTextBlocks.cxx.
References SwImpBlocks::GetIndex(), and SwImpBlocks::m_aNames.
Referenced by CopyBlock(), SwXMLBlockListExport::exportDoc(), GetDoc(), and Rename().
| bool SwXMLTextBlocks::IsOnlyTextBlock | ( | sal_uInt16 | nIdx | ) | const |
Definition at line 494 of file SwXMLTextBlocks.cxx.
References SwImpBlocks::m_aNames.
|
overridevirtual |
Implements SwImpBlocks.
Definition at line 403 of file SwXMLTextBlocks.cxx.
References ERRCODE_NONE, and WriteInfo().
Referenced by CopyBlock(), and PutMuchEntries().
| void SwXMLTextBlocks::MakeBlockText | ( | std::u16string_view | rText | ) |
Definition at line 553 of file SwXMLTextBlocks.cxx.
References SwTextNode::AppendNode(), SwTextNode::ChgFormatColl(), SwImpBlocks::GetIndex(), SwTextNode::GetTextColl(), o3tl::getToken(), SwTextNode::InsertText(), SwImpBlocks::m_xDoc, nPos, and RES_POOLCOLL_STANDARD.
Referenced by GetDoc(), and PutBlockText().
|
overridevirtual |
Implements SwImpBlocks.
Definition at line 452 of file SwXMLTextBlocks.cxx.
References ERRCODE_NONE, comphelper::OStorageHelper::GetStorageFromURL(), InitBlockMode(), and SwImpBlocks::m_aFile.
Referenced by CopyBlock(), GetMacroTable(), PutMuchEntries(), SetMacroTable(), and WriteInfo().
| ErrCode SwXMLTextBlocks::PutBlock | ( | ) |
Definition at line 318 of file SwXMLTextBlocks.cxx.
References ERR_SWG_WRITE_ERROR, ERRCODE_NONE, SwImpBlocks::GetBaseURL(), SfxObjectShell::GetEmbeddedObjectContainer(), comphelper::OStorageHelper::GetTemporaryStorage(), GetXMLWriter(), comphelper::EmbeddedObjectContainer::HasEmbeddedObjects(), m_nFlags, m_xBlkRoot, SwImpBlocks::m_xDoc, m_xRoot, NONE, SfxObjectShell::SaveAsChildren(), SfxObjectShell::SaveCompletedChildren(), and SwWriter::Write().
Referenced by PutDoc().
| ErrCode SwXMLTextBlocks::PutBlockText | ( | const OUString & | rShort, |
| std::u16string_view | rText, | ||
| const OUString & | rPackageName | ||
| ) |
Definition at line 335 of file SwXMLTextBlocks1.cxx.
References Any, ERR_SWG_WRITE_ERROR, ERRCODE_NONE, SwImpBlocks::GetIndex(), comphelper::getProcessComponentContext(), GetXMLToken(), m_nFlags, m_xBlkRoot, m_xRoot, MakeBlockText(), NoRootCommit, and XML_UNFORMATTED_TEXT.
Referenced by PutText().
|
overridevirtual |
Implements SwImpBlocks.
Definition at line 391 of file SwXMLTextBlocks.cxx.
References SwImpBlocks::MakePaM(), and PutBlock().
Referenced by SwAutoCorrect::PutText().
|
overridevirtual |
Reimplemented from SwImpBlocks.
Definition at line 409 of file SwXMLTextBlocks.cxx.
References CloseFile(), ERRCODE_NONE, SwImpBlocks::IsFileChanged(), SwImpBlocks::m_bInPutMuchBlocks, m_nFlags, m_xBlkRoot, MakeBlockList(), NoRootCommit, OpenFile(), and SwImpBlocks::Touch().
|
overridevirtual |
Implements SwImpBlocks.
Definition at line 539 of file SwXMLTextBlocks.cxx.
References ClearDoc(), ERRCODE_NONE, GeneratePackageName(), SwImpBlocks::m_aCurrentText, SwImpBlocks::m_aLong, m_aPackageName, SwImpBlocks::m_aShort, PutBlockText(), and SetIsTextOnly().
|
private |
Definition at line 402 of file SwXMLTextBlocks1.cxx.
References comphelper::getProcessComponentContext(), m_xBlkRoot, TOOLS_WARN_EXCEPTION, XML_NAMESPACE_BLOCKLIST, and XMLN_BLOCKLIST.
Referenced by SwXMLTextBlocks().
|
overridevirtual |
Implements SwImpBlocks.
Definition at line 186 of file SwXMLTextBlocks.cxx.
References ERRCODE_NONE, GeneratePackageName(), IsOnlyTextBlock(), SwImpBlocks::m_aNames, m_aPackageName, SwImpBlocks::m_aShort, m_xBlkRoot, m_xRoot, and SAL_WARN.
|
private |
Definition at line 57 of file SwXMLTextBlocks.cxx.
References m_xBlkRoot, and m_xRoot.
Referenced by CloseFile(), SwXMLTextBlocks(), and ~SwXMLTextBlocks().
| void SwXMLTextBlocks::SetIsTextOnly | ( | const OUString & | rShort, |
| bool | bNewValue | ||
| ) |
Definition at line 477 of file SwXMLTextBlocks.cxx.
References SwImpBlocks::GetIndex(), and SwImpBlocks::m_aNames.
Referenced by BeginPutDoc(), and PutText().
|
overridevirtual |
Reimplemented from SwImpBlocks.
Definition at line 482 of file SwXMLTextBlocks1.cxx.
References aAutotextEvents, Any, CloseFile(), ERR_SWG_WRITE_ERROR, ERRCODE_NONE, comphelper::getProcessComponentContext(), SotStorage::GetVersion(), SwImpBlocks::m_aLong, SwImpBlocks::m_aNames, m_aPackageName, SwImpBlocks::m_aShort, m_xBlkRoot, SwImpBlocks::m_xDoc, m_xRoot, OpenFile(), and SOFFICE_FILEFORMAT_60.
| ErrCode SwXMLTextBlocks::StartPutBlock | ( | const OUString & | rShort, |
| const OUString & | rPackageName | ||
| ) |
Definition at line 288 of file SwXMLTextBlocks.cxx.
References ERRCODE_NONE, SotExchange::GetFormatMimeType(), SwImpBlocks::GetIndex(), m_xBlkRoot, and m_xRoot.
Referenced by BeginPutDoc().
|
private |
Definition at line 438 of file SwXMLTextBlocks1.cxx.
References Any, ERRCODE_NONE, comphelper::getProcessComponentContext(), SwImpBlocks::m_bInfoChanged, m_xBlkRoot, OpenFile(), XML_BLOCK_LIST, and XMLN_BLOCKLIST.
Referenced by CloseFile(), MakeBlockList(), and ~SwXMLTextBlocks().
|
private |
Definition at line 45 of file SwXMLTextBlocks.hxx.
Referenced by AddName(), BeginPutDoc(), Delete(), GetMacroTable(), PutText(), Rename(), and SetMacroTable().
|
private |
Definition at line 44 of file SwXMLTextBlocks.hxx.
Referenced by PutBlock(), PutBlockText(), and PutMuchEntries().
|
private |
Definition at line 47 of file SwXMLTextBlocks.hxx.
Referenced by CopyBlock(), Delete(), GetBlockText(), GetDoc(), GetMacroTable(), InitBlockMode(), PutBlock(), PutBlockText(), PutMuchEntries(), ReadInfo(), Rename(), ResetBlockMode(), SetMacroTable(), StartPutBlock(), and WriteInfo().
|
private |
Definition at line 43 of file SwXMLTextBlocks.hxx.
Referenced by SwXMLTextBlocks(), and ~SwXMLTextBlocks().
|
private |
Definition at line 46 of file SwXMLTextBlocks.hxx.
Referenced by GetDoc().
|
private |
Definition at line 48 of file SwXMLTextBlocks.hxx.
Referenced by GetBlockText(), GetDoc(), GetMacroTable(), InitBlockMode(), PutBlock(), PutBlockText(), Rename(), ResetBlockMode(), SetMacroTable(), and StartPutBlock().