37 #include <osl/module.hxx>
38 #include <rtl/bootstrap.hxx>
40 #include <osl/diagnose.h>
73 else if ( fnGetReader )
75 pReader = (*fnGetReader)();
84 (*fnGetWriter)( rNm, rBaseURL, xWrt );
96 aReaderWriter[ rPos ].
pReader = pReader;
118 if( rEntry.bDelReader && rEntry.pReader )
120 delete rEntry.pReader;
121 rEntry.pReader =
nullptr;
127 #ifndef DISABLE_DYNLOADING
129 oslGenericFunction Filters::GetMswordLibSymbol(
const char *pSymbol )
133 OUString url(
"$LO_LIB_DIR/" SVLIBRARY(
"msword"));
134 rtl::Bootstrap::expandMacros(url);
135 bool ok = msword_.load( url, SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY );
136 SAL_WARN_IF(!ok,
"sw",
"failed to load msword library");
139 return msword_.getFunctionSymbol( OUString::createFromAscii( pSymbol ) );
164 aReaderWriter[
n].
GetWriter( rFltName, rBaseURL, xRet );
230 sal_uInt64* pValues )
237 sal_uInt64* pValues )
240 OUString* pNames = aNames.getArray();
243 for( n = 0; n < nCnt; ++n )
244 pNames[ n ] = OUString::createFromAscii( ppNames[ n ] );
247 if( nCnt == aValues.getLength() )
249 const Any* pAnyValues = aValues.getConstArray();
250 for( n = 0; n < nCnt; ++n )
251 pValues[ n ] = pAnyValues[ n ].hasValue()
252 ? *o3tl::doAccess<sal_uInt64>(pAnyValues[ n ])
257 for( n = 0; n < nCnt; ++n )
280 aSz.reset(static_cast<SwFormatFrameSize*>(pItem->
Clone()));
294 bool bOnlyOneNode =
true;
306 pFirstTextNd = pTextNd;
307 else if( pFirstTextNd != pTextNd )
310 bOnlyOneNode =
false;
322 if( nMinFrame <
MINLAY && pFirstTextNd )
326 SwIndex aNdIdx( pFirstTextNd );
330 nMinFrame, nMaxFrame, nAbsMinCnts );
338 for(
int i = 0;
i < 2; ++
i )
344 nWidthTmp = nWidthTmp + rBoxItem.
GetDistance( nLine );
345 nMinFrame += nWidthTmp;
346 nMaxFrame += nWidthTmp;
348 nLine = SvxBoxItemLine::RIGHT;
357 if( nWidth > static_cast<sal_uInt16>(nMaxFrame) )
359 else if( nWidth > static_cast<sal_uInt16>(nMinFrame) )
367 aSz->SetWidth( nWidth );
368 if(
MINFLY > aSz->GetHeight() )
372 else if(
MINFLY > static_cast<const SwFormatFrameSize*>(pItem)->GetHeight() )
374 std::unique_ptr<SwFormatFrameSize> aSz(static_cast<SwFormatFrameSize*>(pItem->
Clone()));
376 rFlySet.
Put( std::move(aSz) );
383 struct CharSetNameMap
385 rtl_TextEncoding eCode;
389 const CharSetNameMap *GetCharSetNameMap()
391 static const CharSetNameMap aMapArr[] =
393 # define IMPLENTRY(X) { RTL_TEXTENCODING_##X, #X }
494 rtl_TextEncoding CharSetFromName(
const OUString& rChrSetStr)
496 const CharSetNameMap *pStart = GetCharSetNameMap();
497 rtl_TextEncoding nRet = pStart->eCode;
499 for(
const CharSetNameMap *pMap = pStart; pMap->pName; ++pMap)
501 if(rChrSetStr.equalsIgnoreAsciiCaseAscii(pMap->pName))
508 OSL_ENSURE(nRet != pStart->eCode,
"TXT: That was an unknown language!");
516 OUString NameFromCharSet(rtl_TextEncoding nChrSet)
518 const CharSetNameMap *pStart = GetCharSetNameMap();
519 const char *pRet = pStart->pName;
521 for(
const CharSetNameMap *pMap = pStart; pMap->pName; ++pMap)
523 if (nChrSet == pMap->eCode)
530 OSL_ENSURE(pRet != pStart->pName,
"TXT: That was an unknown language!");
532 return OUString::createFromAscii(pRet);
550 OUString sToken = rStr.getToken(0,
',', nToken);
551 if (!sToken.isEmpty())
553 if (nToken >= 0 && !(sToken = rStr.getToken(0,
',', nToken)).isEmpty())
555 if (sToken.equalsIgnoreAsciiCase(
"CRLF"))
557 else if (sToken.equalsIgnoreAsciiCase(
"LF"))
562 if (nToken >= 0 && !(sToken = rStr.getToken(0,
',', nToken)).isEmpty())
564 if (nToken >= 0 && !(sToken = rStr.getToken(0,
',', nToken)).isEmpty())
566 if (nToken >= 0 && !(sToken = rStr.getToken(0,
',', nToken)).isEmpty())
612 #ifdef DISABLE_DYNLOADING
628 #ifndef DISABLE_DYNLOADING
633 return (*pFunction)();
644 #ifndef DISABLE_DYNLOADING
648 (*pFunction)( rFltName, rBaseURL, xRet );
658 #ifndef DISABLE_DYNLOADING
662 return (*pFunction)();
672 #ifndef DISABLE_DYNLOADING
676 (*pFunction)( rFltName, rBaseURL, xRet );
686 #ifndef DISABLE_DYNLOADING
690 return (*pFunction)();
703 #ifndef DISABLE_DYNLOADING
706 return ErrCode(pFunction( rDoc, rStor, bSaveInto, rStorageName ));
715 #ifndef DISABLE_DYNLOADING
718 return ErrCode(pFunction( rDocS ));
const SwEndNode * EndOfSectionNode() const
tools::Long GetWidth() const
sal_uLong GetIndex() const
rtl_TextEncoding m_eCharSet
oslGenericFunction GetMswordLibSymbol(const char *pSymbol)
ErrCode SaveOrDelMSVBAStorage(SfxObjectShell &rDoc, SotStorage &rStor, bool bSaveInto, const OUString &rStorageName)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
SAL_DLLPUBLIC_EXPORT sal_uInt32 SaveOrDelMSVBAStorage_ww8(SfxObjectShell &rDoc, SotStorage &rStor, sal_Bool bSaveInto, const OUString &rStorageName)
static OUString convertToBcp47(LanguageType nLangID)
void(* FnGetWriter)(const OUString &, const OUString &rBaseURL, WriterRef &)
tools::SvRef< Writer > WriterRef
virtual SwReaderType GetReaderType() override
sal_uInt16 GetDistance(SvxBoxItemLine nLine) const
SwFilterOptions(sal_uInt16 nCnt, const char **ppNames, sal_uInt64 *pValues)
Dialog to specify the properties of date form field.
SAL_DLLPUBLIC_EXPORT Reader * ImportRTF()
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
SwTableFormat * GetFrameFormat()
static Reader * GetWW8Reader()
static LanguageType convertToLanguageTypeWithFallback(const OUString &rBcp47)
sw::Filters & getFilters()
sal_uInt16 GetOutWidth() const
Reader * GetReader(const OUString &rFltName)
Return reader based on the name.
sal_uLong GetIndex() const
SAL_DLLPUBLIC_EXPORT void ExportDOC(const OUString &rFltName, const OUString &rBaseURL, WriterRef &xRet)
static void SetFltPtr(sal_uInt16 rPos, Reader *pReader)
const SwTable & GetTable() const
const editeng::SvxBorderLine * GetLine(SvxBoxItemLine nLine) const
SAL_DLLPUBLIC_EXPORT void ExportRTF(const OUString &rFltName, const OUString &rBaseURL, WriterRef &xRet)
void GetWriter(const OUString &rNm, const OUString &rBaseURL, WriterRef &xWrt) const
Get access to the writer.
ErrCode GetSaveWarningOfMSVBAStorage(SfxObjectShell &rDocS)
Reader *(* FnGetReader)()
static SwReaderWriterEntry aReaderWriter[]
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
static Reader * GetDOCXReader()
void ReadUserData(const OUString &)
static Reader * GetRTFReader()
void GetWW8Writer(const OUString &rFltName, const OUString &rBaseURL, WriterRef &xRet)
Marks a character position inside a document model node.
void GetValues(sal_uInt16 nCnt, const char **ppNames, sal_uInt64 *pValues)
css::uno::Sequence< css::uno::Any > GetProperties(const css::uno::Sequence< OUString > &rNames)
virtual bool IsStgWriter() const override
Reader * GetReader()
Get access to the reader.
SwIoDetect aFilterDetect[]
Marks a node in the document model.
void GetHTMLWriter(const OUString &rFilterOptions, const OUString &rBaseURL, WriterRef &xRet)
SAL_DLLPUBLIC_EXPORT sal_uInt32 GetSaveWarningOfMSVBAStorage_ww8(SfxObjectShell &rDocS)
Reader * SwGetReaderXML()
virtual void SetFltName(const OUString &r) override
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
void WriteUserData(OUString &)
void GetASCWriter(const OUString &rFltNm, [[maybe_unused]] const OUString &, WriterRef &xRet)
void EraseText(const SwIndex &rIdx, const sal_Int32 nCount=SAL_MAX_INT32, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
delete text content ATTENTION: must not be called with a range that overlaps the start of an attribut...
OUString InsertText(const OUString &rStr, const SwIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
void GetRTFWriter(const OUString &rFltName, const OUString &rBaseURL, WriterRef &xRet)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void CalculateFlySize(SfxItemSet &rFlySet, const SwNodeIndex &rAnchor, SwTwips nPageWidth)
SwTextNode is a paragraph in the document model.
virtual void SetFltName(const OUString &rFltNm)
void GetMinMaxSize(sal_uLong nIndex, sal_uLong &rMin, sal_uLong &rMax, sal_uLong &rAbs) const
Is in itratr.
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
#define SAL_WARN_IF(condition, area, stream)
virtual void ImplCommit() override
SAL_DLLPUBLIC_EXPORT Reader * ImportDOC()
void GetXMLWriter([[maybe_unused]] const OUString &, const OUString &rBaseURL, WriterRef &xRet)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
sal_uInt32(* SaveOrDel)(SfxObjectShell &, SotStorage &, sal_Bool, const OUString &)
SwTableNode * FindTableNode()
Search table node, in which it is.
void GetWriter(const OUString &rFltName, const OUString &rBaseURL, WriterRef &xRet)
Return writer based on the name.
SAL_DLLPUBLIC_EXPORT Reader * ImportDOCX()
sal_uInt32(* GetSaveWarning)(SfxObjectShell &)
sal_uInt16 GetInWidth() const
virtual bool IsStgWriter() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.