28#include <osl/diagnose.h>
37#include <com/sun/star/ucb/ContentCreationException.hpp>
54 void InsertBkmk( const ::sw::mark::IMark& rBkmk );
76 if(rBkmk.IsExpanded() && rBkmk.GetOtherMarkPos().GetNodeIndex() != nNd)
78 nNd = rBkmk.GetOtherMarkPos().GetNodeIndex();
98 , m_pOrigFileName(nullptr), m_pDoc(nullptr), m_pOrigPam(nullptr)
99 , m_bHideDeleteRedlines(false)
169std::shared_ptr<SwUnoCursor>
176 if( !pCNode &&
nullptr == pNds->
GoNext( &aStt ) )
178 OSL_FAIL(
"No more ContentNode at StartPos" );
187 assert(pCNode &&
"No more ContentNode at StartPos");
188 pNew->GetPoint()->AssignEndIndex( *pCNode );
195 assert(
m_pImpl->m_pStream &&
"Oh-oh. Writer with no Stream!");
212 nResult =
Write( rPaM, *aRef, pFName );
216 catch (
const css::ucb::ContentCreationException &)
254 OSL_ENSURE(
false,
"Write in Storages on a stream?" );
260 OSL_ENSURE(
false,
"Write in Storages on a stream?" );
273 if( ! ( INetProtocol::File == aFileUrl.GetProtocol() &&
276 INetProtocol::VndSunStarWebdav >= aTargetUrl.
GetProtocol() ) )
280 std::map<OUString, OUString>::iterator it =
m_pImpl->maFileNameMap.find( rFileNm );
281 if ( it !=
m_pImpl->maFileNameMap.end() )
283 rFileNm = it->second;
287 OUString aSrc = rFileNm;
290 SfxMedium aSrcFile( aSrc, StreamMode::READ );
291 SfxMedium aDstFile( aDest, StreamMode::WRITE | StreamMode::SHARE_DENYNONE );
302 m_pImpl->maFileNameMap.insert( std::make_pair( aSrc, aDest ) );
320 for(
size_t nGet = rListTable.
size(); nGet; )
322 SwNumRule const*
const pRule = rListTable[ --nGet ];
336 if( *pFont == *pDefFont )
339 else if( *pFont == *pDefFont )
343 pFont->GetFamilyName(), pFont->GetStyleName(),
368 if(
nullptr != pFont )
382 pItem = &rPool.
Put( aFont );
385 pItem = &rPool.
Put( rFont );
387 if( 1 < pItem->GetRefCount() )
391 m_pImpl->aFontRemoveLst.push_back( pItem );
410 sal_Int32 nEnd, std::vector< const ::sw::mark::IMark* >& rArr)
412 OSL_ENSURE( rArr.empty(),
"there are still entries available" );
415 std::pair<SwBookmarkNodeTable::const_iterator, SwBookmarkNodeTable::const_iterator> aIterPair
416 =
m_pImpl->aBkmkNodePos.equal_range( nNd );
417 if( aIterPair.first != aIterPair.second )
420 if( !nStt && nEnd == rNd.
Len() )
422 for( SwBookmarkNodeTable::const_iterator it = aIterPair.first; it != aIterPair.second; ++it )
423 rArr.push_back( it->second );
426 for( SwBookmarkNodeTable::const_iterator it = aIterPair.first; it != aIterPair.second; ++it )
428 const ::sw::mark::IMark& rBkmk = *(it->second);
430 if( rBkmk.GetMarkPos().GetNode() == rNd &&
431 (nContent = rBkmk.GetMarkPos().GetContentIndex() ) >= nStt &&
434 rArr.push_back( &rBkmk );
436 else if( rBkmk.IsExpanded() &&
437 (rNd == rBkmk.GetOtherMarkPos().GetNode()) &&
438 (nContent = rBkmk.GetOtherMarkPos().GetContentIndex()) >= nStt &&
441 rArr.push_back( &rBkmk );
446 return !rArr.empty();
452 OSL_ENSURE(
false,
"Write in Storages on a stream?" );
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
Provides access to the marks of a document.
virtual const_iterator_t findFirstBookmarkStartsAfter(const SwPosition &rPos) const =0
Finds the first mark that is starting after.
virtual const_iterator_t getBookmarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence the IBookmarks.
virtual const_iterator_t getBookmarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of IBookmarks.
Provides access to settings of a document.
Access to the style pool.
OUString GetPartBeforeLastName() const
INetProtocol GetProtocol() const
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
SfxItemPool * GetSecondaryPool() const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
const SfxPoolItem * GetPoolDefaultItem(sal_uInt16 nWhich) const
const T & Put(std::unique_ptr< T > xItem, sal_uInt16 nWhich=0)
void Remove(const SfxPoolItem &)
void Close(bool bInDestruction=false)
SvStream * GetOutStream()
tools::SvRef< SotStorage > m_pStg
virtual ErrCode WriteMedium(SfxMedium &)=0
virtual ErrCode WriteStream() override
css::uno::Reference< css::embed::XStorage > m_xStg
virtual ErrCode WriteStorage()=0
virtual ErrCode Write(SwPaM &, const css::uno::Reference< css::embed::XStorage > &, const OUString *, SfxMedium *=nullptr) override
SvStream & WriteStream(SvStream &rStream)
SvxNumType GetNumberingType() const
virtual sal_Int32 Len() const
bool IsUsed(const sw::BroadcastingModify &) const
const SwNumRuleTable & GetNumRuleTable() const
IDocumentSettingAccess const & getIDocumentSettingAccess() const
IDocumentMarkAccess * getIDocumentMarkAccess()
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
const SwAttrPool & GetAttrPool() const
Marks a node in the document model.
SwNodeOffset GetIndex() const
SwContentNode * GetContentNode()
static SwContentNode * GoPrevious(SwNodeIndex *)
SwContentNode * GoNext(SwNodeIndex *) const
const SwNumFormat & Get(sal_uInt16 i) const
PaM is Point and Mark: a selection of the document model.
const SwPosition * End() const
const SwPosition * Start() const
bool CopyNextPam(SwPaM **)
bool m_bWriteOnlyFirstTable
virtual void SetupFilterOptions(SfxMedium &rMedium)
sal_Int32 FindPos_Bkmk(const SwPosition &rPos) const
void AddFontItem(SfxItemPool &rPool, const SvxFontItem &rFont)
virtual ErrCode WriteStream()=0
void SetStream(SvStream *const pStream)
void PutEditEngFontsInAttrPool()
bool GetBookmarks(const SwContentNode &rNd, sal_Int32 nStt, sal_Int32 nEnd, std::vector< const ::sw::mark::IMark * > &rArr)
IDocumentSettingAccess & getIDocumentSettingAccess()
void CreateBookmarkTable()
bool m_bUCS2_WithStartChar
static std::shared_ptr< SwUnoCursor > NewUnoCursor(SwDoc &rDoc, SwNodeOffset const nStartIdx, SwNodeOffset const nEndIdx)
void PutNumFormatFontsInAttrPool()
void AddFontItems_(SfxItemPool &rPool, sal_uInt16 nWhichId)
virtual ~Writer() override
std::shared_ptr< SwUnoCursor > m_pCurrentPam
bool m_bExportParagraphNumbering
const OUString * m_pOrigFileName
virtual ErrCode Write(SwPaM &, SfxMedium &, const OUString *)
bool m_bASCII_NoLastLineEnd
virtual bool IsStgWriter() const
std::unique_ptr< Writer_Impl > m_pImpl
bool m_bWriteClipboardDoc
IDocumentStylePoolAccess & getIDocumentStylePoolAccess()
bool CopyLocalFileToINet(OUString &rFileNm)
bool m_bASCII_ParaAsBlank
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
GtkMediaStream * m_pStream
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Marks a position in the document model.
SwBookmarkNodeTable aBkmkNodePos
void InsertBkmk(const ::sw::mark::IMark &rBkmk)
std::vector< const SvxFontItem * > aFontRemoveLst
void RemoveFontList(SwDoc &rDoc)
std::map< OUString, OUString > maFileNameMap
#define ERR_SWG_WRITE_ERROR
constexpr sal_uInt8 MAXLEVEL
std::multimap< SwNodeOffset, const ::sw::mark::IMark * > SwBookmarkNodeTable