21#include <officecfg/Office/Common.hxx>
38#include <LibreOfficeKit/LibreOfficeKitEnums.h>
68#include <unoprnms.hxx>
83#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
84#include <com/sun/star/lang/DisposedException.hpp>
85#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
86#include <com/sun/star/lang/NoSupportException.hpp>
87#include <com/sun/star/beans/PropertyAttribute.hpp>
88#include <com/sun/star/beans/XFastPropertySet.hpp>
89#include <com/sun/star/beans/XPropertyAccess.hpp>
90#include <com/sun/star/document/RedlineDisplayType.hpp>
91#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
92#include <com/sun/star/frame/XController.hpp>
93#include <com/sun/star/frame/XFrame.hpp>
94#include <com/sun/star/script/XInvocation.hpp>
95#include <com/sun/star/view/XSelectionSupplier.hpp>
102#include <strings.hrc>
103#include <bitmaps.hlst>
117#include <drawdoc.hxx>
119#include <osl/file.hxx>
154#include <editeng/editeng.hxx>
184using ::osl::FileBase;
193 const bool bWebDoc =
nullptr !=
dynamic_cast< const SwWebDocShell *
>(pDocShell);
194 const bool bSwSrcView =
nullptr !=
dynamic_cast< const SwSrcView *
>(pView);
195 const SwView * pSwView =
dynamic_cast< const SwView *
>(pView);
196 const bool bHasSelection = pSwView && pSwView->
HasSelection(
false );
203 sal_uInt16 nCurrentPage = 1;
212 else if (!bSwSrcView)
215 OSL_ENSURE(pPreview,
"Unexpected type of the view shell");
226 sal_uInt16 nMax = nCurrentPage;
228 while (pPage && nMax-- > 0)
235 return std::make_unique<SwPrintUIOptions>( nCurrentPage, bWebDoc, bSwSrcView, bHasSelection, bHasPostIts, rPrintData );
245 if( USHRT_MAX !=
nId )
257 if( pFound == pToClose)
276 return theSwXTextDocumentUnoTunnelId.
getSeq();
281 if( comphelper::isUnoTunnelId<SwXTextDocument>(rId) )
285 if( comphelper::isUnoTunnelId<SfxObjectShell>(rId) )
298 Reference<XUnoTunnel> xNumTunnel;
299 aNumTunnel >>= xNumTunnel;
300 return (xNumTunnel.is()) ? xNumTunnel->getSomething(rId) : 0;
305 Any aRet = SwXTextDocumentBaseClass::queryInterface(rType);
306 if ( !aRet.hasValue() )
308 if ( !aRet.hasValue() &&
311 Reference<lang::XMultiServiceFactory> xTmp =
this;
314 if ( !aRet.hasValue() &&
317 Reference<tiledrendering::XTiledRenderable> xTmp =
this;
321 if ( !aRet.hasValue()
348 Sequence< uno::Type > aNumTypes;
354 Reference<XTypeProvider> xNumProv;
355 if(aNumProv >>= xNumProv)
357 aNumTypes = xNumProv->getTypes();
362 SwXTextDocumentBaseClass::getTypes(),
375 m_bObjectValid(pShell != nullptr),
376 m_pHiddenViewFrame(nullptr),
378 m_bApplyPagePrintSettingsFromXPagePrintable( false )
393 Reference< XInterface > x0;
437 Reference< XUnoTunnel > xNumTunnel;
438 aNumTunnel >>= xNumTunnel;
440 = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xNumTunnel);
441 OSL_ENSURE(pNumFormat,
"No number formatter available");
456 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
468 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
475 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
508 Reference< XInterface > xRef;
563 uno::Sequence< uno::Any > aArgs;
586 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
599 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
611 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
623 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
631Reference< XPropertySet > SAL_CALL
636 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
648 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
660 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
672 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
691 xCursor.set(
static_cast<text::XWordCursor*
>(pXTextCursor.get()) );
693 auto& rUnoCursor(pXTextCursor->GetCursor());
694 rUnoCursor.SetRemainInSection(
false);
703 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
705 Reference< XTextCursor > xCursor;
716 pUnoCursor->SetRemainInSection(
false);
731 nResult = pUnoCursor->FindAttrs(aSearch, !pSearch->
m_bStyles,
732 eStart, eEnd, bCancel,
743 nResult = pUnoCursor->FindFormat(*pSearchColl,
744 eStart, eEnd, bCancel,
745 static_cast<FindRanges>(eRanges), pReplaceColl );
752 nResult = pUnoCursor->Find_Text(aSearchOpt,
false,
753 eStart, eEnd, bCancel,
769 Reference< XTextCursor > & xCursor,
772 Reference< XInterface >
const & xLastResult)
774 const auto pSearch =
dynamic_cast<SwXTextSearch*
>(xDesc.get());
780 bool bParentInExtra =
false;
783 OTextCursorHelper* pPosCursor =
dynamic_cast<OTextCursorHelper*
>(xLastResult.get());
784 SwPaM* pCursor = pPosCursor ? pPosCursor->GetPaM() :
nullptr;
788 pUnoCursor->DeleteMark();
796 if(pUnoCursor->HasMark())
798 if(*pUnoCursor->GetPoint() < *pUnoCursor->GetMark())
799 pUnoCursor->Exchange();
800 pUnoCursor->DeleteMark();
803 const SwNode& rRangeNode = pUnoCursor->GetPointNode();
811 pSearch->FillSearchOptions( aSearchOpt );
830 for (
int nSearchProc = 0; nSearchProc < 2; ++nSearchProc)
833 if(pSearch->HasSearchAttributes())
841 pSearch->FillSearchItemSet(aSearch);
843 nResult = pUnoCursor->FindAttrs(aSearch, !pSearch->m_bStyles,
844 eStart, eEnd, bCancel,
846 !pSearch->m_sSearchText.isEmpty() ? &aSearchOpt :
nullptr );
848 else if(pSearch->m_bStyles)
854 nResult = pUnoCursor->FindFormat(*pSearchColl,
855 eStart, eEnd, bCancel,
856 eRanges, pReplaceColl );
862 nResult = pUnoCursor->Find_Text(aSearchOpt,
false,
863 eStart, eEnd, bCancel,
874Reference< XIndexAccess >
878 Reference< XInterface > xTmp;
879 sal_Int32 nResult = 0;
880 Reference< XTextCursor > xCursor;
881 auto pResultCursor(
FindAny(xDesc, xCursor,
true, nResult, xTmp));
891 Reference< XInterface > xTmp;
892 sal_Int32 nResult = 0;
893 Reference< XTextCursor > xCursor;
894 auto pResultCursor(
FindAny(xDesc, xCursor,
false, nResult, xTmp));
897 Reference< XInterface > xRet;
900 const uno::Reference< text::XText > xParent =
902 *pResultCursor->GetPoint());
909 const Reference< util::XSearchDescriptor > & xDesc)
912 sal_Int32 nResult = 0;
913 Reference< XTextCursor > xCursor;
916 auto pResultCursor(
FindAny(xDesc, xCursor,
false, nResult, xStartAt));
919 Reference< XInterface > xRet;
922 const uno::Reference< text::XText > xParent =
924 *pResultCursor->GetPoint());
934 Sequence< beans::PropertyValue >
aSeq(9);
936 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
938 beans::PropertyValue* pArray =
aSeq.getArray();
944 aVal <<=
aData.GetRow();
945 pArray[0] = beans::PropertyValue(
"PageRows", -1, aVal, PropertyState_DIRECT_VALUE);
946 aVal <<=
aData.GetCol();
947 pArray[1] = beans::PropertyValue(
"PageColumns", -1, aVal, PropertyState_DIRECT_VALUE);
949 pArray[2] = beans::PropertyValue(
"LeftMargin", -1, aVal, PropertyState_DIRECT_VALUE);
951 pArray[3] = beans::PropertyValue(
"RightMargin", -1, aVal, PropertyState_DIRECT_VALUE);
953 pArray[4] = beans::PropertyValue(
"TopMargin", -1, aVal, PropertyState_DIRECT_VALUE);
955 pArray[5] = beans::PropertyValue(
"BottomMargin", -1, aVal, PropertyState_DIRECT_VALUE);
957 pArray[6] = beans::PropertyValue(
"HoriMargin", -1, aVal, PropertyState_DIRECT_VALUE);
959 pArray[7] = beans::PropertyValue(
"VertMargin", -1, aVal, PropertyState_DIRECT_VALUE);
960 aVal <<=
aData.GetLandscape();
961 pArray[8] = beans::PropertyValue(
"IsLandscape", -1, aVal, PropertyState_DIRECT_VALUE);
969 TypeClass
eType = rValue.getValueType().getTypeClass();
972 if(
eType == TypeClass_UNSIGNED_LONG )
977 bException = !(rValue >>= nVal);
979 nRet =
static_cast<sal_uInt32
>(nVal);
987 OUStringBuffer sEntry;
1000 sEntry.append( OUString::number(nVal) +
".");
1004 sEntry.append(sOutlineText);
1005 return sEntry.makeStringAndClear();
1012 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1019 for(
const beans::PropertyValue& rProperty : aSettings)
1021 OUString
sName = rProperty.Name;
1022 const Any& rVal = rProperty.Value;
1025 if(
sName ==
"PageRows" )
1027 if(!nVal || nVal > 0xff)
1031 else if(
sName ==
"PageColumns")
1033 if(!nVal || nVal > 0xff)
1037 else if(
sName ==
"LeftMargin")
1041 else if(
sName ==
"RightMargin")
1045 else if(
sName ==
"TopMargin")
1049 else if(
sName ==
"BottomMargin")
1053 else if(
sName ==
"HoriMargin")
1057 else if(
sName ==
"VertMargin")
1061 else if(
sName ==
"IsLandscape")
1067 aData.SetLandscape(*b);
1083 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1090 for (
const beans::PropertyValue &rProp : xOptions )
1093 Any aValue( rProp.Value );
1099 if ( rProp.Value >>= sFileURL )
1102 OUString sSystemPath;
1103 FileBase::getSystemPathFromFileURL ( sFileURL, sSystemPath );
1107 throw IllegalArgumentException();
1113 sal_Int32 nCopies = 0;
1123 throw IllegalArgumentException();
1133 throw IllegalArgumentException();
1142 if ( !(rProp.Value >>= sTmp) )
1143 throw IllegalArgumentException();
1162 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1174 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1186 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1198 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1210 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1222 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1234 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1246 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1258 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1270 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1282 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1295 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1309class SwDrawPagesObj :
public cppu::WeakImplHelper<
1310 css::drawing::XDrawPages,
1311 css::lang::XServiceInfo>
1314 css::uno::Reference< css::drawing::XDrawPageSupplier > m_xDoc;
1316 SwDrawPagesObj(css::uno::Reference< css::drawing::XDrawPageSupplier > xDoc) : m_xDoc(
std::move(xDoc)) {}
1319 virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
1320 insertNewByIndex(sal_Int32 )
override {
throw css::lang::NoSupportException(); }
1322 virtual void SAL_CALL
remove(
const css::uno::Reference< css::drawing::XDrawPage >& )
override
1324 throw css::lang::NoSupportException();
1328 virtual sal_Int32 SAL_CALL getCount()
override {
return 1; }
1330 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32
Index)
override
1333 throw css::lang::IndexOutOfBoundsException(
"Writer documents have only one DrawPage!");
1334 return css::uno::Any(m_xDoc->getDrawPage());
1338 virtual css::uno::Type SAL_CALL getElementType()
override
1343 virtual sal_Bool SAL_CALL hasElements()
override {
return true; }
1348 return "SwDrawPagesObj";
1358 return {
"com.sun.star.drawing.DrawPages" };
1369 return new SwDrawPagesObj(
this);
1379 Reference< XUnoTunnel > xNumTunnel;
1380 aNumTunnel >>= xNumTunnel;
1382 = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xNumTunnel);
1383 OSL_ENSURE(pNumFormat,
"No number formatter available");
1386 OSL_ENSURE(pNumFormat,
"No number formatter available");
1391 std::unique_lock aGuard(
m_pImpl->m_Mutex);
1392 m_pImpl->m_RefreshListeners.disposeAndClear(aGuard, ev);
1440 Reference< XUnoTunnel > xNumTunnel;
1441 aNumTunnel >>= xNumTunnel;
1443 = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xNumTunnel);
1444 OSL_ENSURE(pNumFormat,
"No number formatter available");
1587 OUString
const & rServiceName,
1588 css::uno::Sequence<css::uno::Any>
const * arguments)
1592 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1599 if (rServiceName ==
"com.sun.star.drawing.DashTable")
1603 if (rServiceName ==
"com.sun.star.drawing.GradientTable")
1607 if (rServiceName ==
"com.sun.star.drawing.HatchTable")
1611 if (rServiceName ==
"com.sun.star.drawing.BitmapTable")
1615 if (rServiceName ==
"com.sun.star.drawing.TransparencyGradientTable")
1619 if (rServiceName ==
"com.sun.star.drawing.MarkerTable")
1623 if (rServiceName ==
"com.sun.star.drawing.Defaults")
1627 if (rServiceName ==
"com.sun.star.document.Settings")
1631 if (rServiceName ==
"com.sun.star.document.ImportEmbeddedObjectResolver")
1635 *
m_pDocShell, SvXMLEmbeddedObjectHelperMode::Read));
1637 if (rServiceName ==
"com.sun.star.text.DocumentSettings")
1641 if (rServiceName ==
"com.sun.star.chart2.data.DataProvider")
1643 return Reference<XInterface>(
1644 static_cast<chart2::data::XDataProvider *
>(
1646 GetChartDataProvider()));
1648 if (!rServiceName.startsWith(
"com.sun.star.")
1649 || rServiceName.endsWith(
".OLE2Shape"))
1656 throw ServiceNotRegisteredException();
1661 OUString aTmpServiceName(rServiceName);
1662 if (rServiceName ==
"com.sun.star.drawing.temporaryForXMLImportOLE2Shape")
1664 aTmpServiceName =
"com.sun.star.drawing.OLE2Shape";
1666 Reference<XInterface> xTmp(
1667 arguments ==
nullptr
1670 aTmpServiceName, *arguments));
1671 if (rServiceName ==
"com.sun.star.drawing.GroupShape"
1672 || rServiceName ==
"com.sun.star.drawing.Shape3DSceneObject")
1676 if (rServiceName.startsWith(
"com.sun.star.drawing."))
1685 return create(rServiceName,
nullptr);
1689 const OUString& ServiceSpecifier,
1690 const Sequence< Any >& Arguments)
1692 return create(ServiceSpecifier, &Arguments);
1697 static Sequence< OUString > aServices;
1698 if ( !aServices.hasElements() )
1704 auto nLength = aRet.getLength();
1705 aRet.getArray()[
i] = aRet[
nLength - 1];
1717 return "SwXTextDocument";
1736 bool bTextDoc = (!bWebDoc && !bGlobalDoc);
1738 Sequence< OUString > aRet (3);
1739 OUString* pArray = aRet.getArray();
1741 pArray[0] =
"com.sun.star.document.OfficeDocument";
1742 pArray[1] =
"com.sun.star.text.GenericTextDocument";
1745 pArray[2] =
"com.sun.star.text.TextDocument";
1747 pArray[2] =
"com.sun.star.text.WebDocument";
1748 else if (bGlobalDoc)
1749 pArray[2] =
"com.sun.star.text.GlobalDocument";
1758 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1777 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1782 throw UnknownPropertyException(rPropertyName);
1783 if(pEntry->
nFlags & PropertyAttribute::READONLY)
1784 throw PropertyVetoException();
1785 switch(pEntry->
nWID)
1798 SW_MOD()->GetModuleConfig()->SetWordDelimiter(sDelim);
1804 bool bSet = *o3tl::doAccess<bool>(aValue);
1821 Sequence <sal_Int8> aNew;
1826 if(aNew.hasElements())
1843 SW_MOD()->GetModuleConfig()->SetHideFieldTips(*o3tl::doAccess<bool>(aValue));
1856 case RedlineDisplayType::
1859 default:
throw IllegalArgumentException();
1866 sal_Int16 nYear = 0;
1876 bool bAuto = *o3tl::doAccess<bool>(aValue);
1878 if (
nullptr != pDrawDoc )
1896 bool bMode = *o3tl::doAccess<bool>(aValue);
1898 if (
nullptr != pDrawDoc )
1920 if( aValue >>= bBool )
1930 if (aValue >>= bBool)
1947 bool bDefaultPageMode(
false );
1948 aValue >>= bDefaultPageMode;
1953 setGrabBagItem(aValue);
1959 std::unique_ptr<SfxPoolItem> pNewItem(rItem.
Clone());
1960 pNewItem->PutValue(aValue, pEntry->
nMemberId);
1970 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1972 if (rPropertyName ==
"ODFExport_ListNodes")
1979 std::vector<css::uno::Sequence<css::uno::Any>> nodes;
1985 pNumRule->GetTextNodeList(textNodes);
1986 css::uno::Any styleIntPtr(
reinterpret_cast<sal_uInt64
>(pNumRule));
1988 for (
const SwTextNode* pTextNode : textNodes)
1990 css::uno::Any
index(pTextNode->GetIndex().get());
1991 css::uno::Any list_id(pTextNode->GetListId());
1993 nodes.push_back({
index, styleIntPtr, list_id });
2002 throw UnknownPropertyException(rPropertyName);
2004 switch(pEntry->
nWID)
2015 switch(pEntry->
nWID)
2026 aAny <<=
SW_MOD()->GetDocStatWordDelim();
2055 aAny <<=
SW_MOD()->GetModuleConfig()->IsHideFieldTips();
2065 nRet = RedlineDisplayType::REMOVED;
2067 nRet = RedlineDisplayType::INSERTED_AND_REMOVED;
2087 if (
nullptr != pDrawDoc )
2098 if (
nullptr != pDrawDoc )
2118 aAny <<= OUString(
"ThisWordDoc" );
2122 aAny <<= getRuntimeUID();
2131 aAny <<= hasValidSignatures();
2134 getGrabBagItem(aAny);
2147 const Reference< XPropertyChangeListener > & )
2149 OSL_FAIL(
"not implemented");
2153 const Reference< XPropertyChangeListener > & )
2155 OSL_FAIL(
"not implemented");
2159 const Reference< XVetoableChangeListener > & )
2161 OSL_FAIL(
"not implemented");
2165 const Reference< XVetoableChangeListener > & )
2167 OSL_FAIL(
"not implemented");
2193 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2194 m_pImpl->m_RefreshListeners.notifyEach(aGuard,
2195 & util::XRefreshListener::refreshed, ev);
2202 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2211 const Reference<util::XRefreshListener> & xListener)
2215 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2216 m_pImpl->m_RefreshListeners.addInterface(aGuard, xListener);
2221 const Reference<util::XRefreshListener> & xListener)
2225 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2226 m_pImpl->m_RefreshListeners.removeInterface(aGuard, xListener);
2234 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2250 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2254 throw UnknownPropertyException(rPropertyName);
2255 return PropertyState_DIRECT_VALUE;
2260 const sal_Int32
nCount = rPropertyNames.getLength();
2261 Sequence < PropertyState > aRet (
nCount );
2263 std::transform(rPropertyNames.begin(), rPropertyNames.end(), aRet.getArray(),
2264 [
this](
const OUString& rName) -> PropertyState { return getPropertyState(rName); });
2273 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2277 throw UnknownPropertyException(rPropertyName);
2278 switch(pEntry->
nWID)
2280 case 0:
default:
break;
2288 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2292 throw UnknownPropertyException(rPropertyName);
2294 switch(pEntry->
nWID)
2296 case 0:
default:
break;
2306 uno::Reference< awt::XDevice > xRenderDevice;
2307 aAny >>= xRenderDevice;
2308 if (xRenderDevice.is())
2318 const uno::Sequence< beans::PropertyValue >& rOptions,
2319 const char *pPropName )
2321 return std::any_of(rOptions.begin(), rOptions.end(),
2322 [&pPropName](
const beans::PropertyValue& rProp) {
2323 return rProp.Name.equalsAscii( pPropName ); });
2327 const uno::Sequence< beans::PropertyValue >& rOptions,
2328 const char *pPropName )
2331 auto pOption = std::find_if(rOptions.begin(), rOptions.end(),
2332 [&pPropName](
const beans::PropertyValue& rProp) {
2333 return rProp.Name.equalsAscii( pPropName ); });
2334 if (pOption != rOptions.end())
2335 pOption->Value >>= bRes;
2340 bool &rbIsSwSrcView,
2341 const uno::Sequence< beans::PropertyValue >& rOptions,
2351 auto pOption = std::find_if(rOptions.begin(), rOptions.end(),
2352 [](
const beans::PropertyValue& rProp) { return rProp.Name ==
"View"; });
2353 if (pOption != rOptions.end())
2354 aTmp = pOption->
Value;
2359 OSL_ENSURE(
xController.is(),
"controller is empty!" );
2379 SwDoc *pDoc =
nullptr;
2381 uno::Reference< frame::XModel >
xModel;
2387 OSL_ENSURE( !
xModel.is(),
"unexpected model found" );
2396 bool bIsSwSrcView =
false;
2398 OSL_ENSURE( bIsPDFExport,
"view is missing, guessing one..." );
2402 OSL_ENSURE( rpView,
"SwViewShell missing" );
2406 if (
auto pSwView =
dynamic_cast<SwView *
>( rpView ))
2410 OSL_FAIL(
"GetRenderDoc: no renderdata");
2416 xDocSh = pSwView->CreateTmpSelectionDoc();
2421 pDoc =
static_cast<SwDocShell*
>(&xDocSh)->GetDoc();
2427 OSL_FAIL(
"unexpected SwViewShell" );
2465 const uno::Sequence< beans::PropertyValue >& rxOptions )
2470 throw DisposedException( OUString(),
2471 static_cast< XTextDocument*
>(
this) );
2475 bool bIsSwSrcView =
false;
2485 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2486 if (!pDoc || !pView)
2497 nRet = rSwSrcView.
PrintSource( pOutDev, 1 ,
true );
2512 if ( bIsPDFExport && bFormat )
2520 pViewShell =
static_cast<SwPagePreview*
>(pView)->GetViewShell();
2523 if (!pViewShell || !pViewShell->
GetLayout())
2566 bool setShowPlaceHoldersInPDF =
false;
2569 m_pRenderData->ViewOptionAdjust( pPrtOptions, setShowPlaceHoldersInPDF );
2582 bool bStateChanged =
false;
2587 bStateChanged =
true;
2589 pViewShell->SwViewShell::UpdateFields(
true);
2601 const sal_Int32 nPageCount = pViewShell->
GetPageCount();
2609 nRet =
m_pRenderData->GetPagePairsForProspectPrinting().size();
2633 OSL_ENSURE( nRet >= 0,
"negative number of pages???" );
2643 sal_Int32 nRenderer,
2645 const uno::Sequence< beans::PropertyValue >& rxOptions )
2650 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2654 bool bIsSwSrcView =
false;
2668 const bool bIsSkipEmptyPages = !
m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport );
2669 const bool bPrintPaperFromSetup =
m_pPrintUIOptions->getBoolValue(
"PrintPaperFromSetup" );
2672 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2673 if (!pDoc || !pView)
2674 return uno::Sequence< beans::PropertyValue >();
2680 throw IllegalArgumentException();
2682 sal_Int32 nMaxRenderer = 0;
2686 nMaxRenderer = bPrintProspect?
2687 m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
2692 if (!bIsSwSrcView &&
m_pRenderData && nRenderer > nMaxRenderer)
2693 return uno::Sequence< beans::PropertyValue >();
2695 uno::Sequence< beans::PropertyValue > aRenderer;
2702 const sal_Int32 nPage = bPrintProspect
2707 sal_Int32 nPrinterPaperTray = -1;
2708 if (! bPrintPaperFromSetup)
2711 const std::map< sal_Int32, sal_Int32 > &rPaperTrays =
m_pRenderData->GetPrinterPaperTrays();
2712 std::map< sal_Int32, sal_Int32 >::const_iterator aIt( rPaperTrays.find( nPage ) );
2713 if (aIt != rPaperTrays.end())
2714 nPrinterPaperTray = aIt->second;
2717 awt::Size aPageSize;
2718 awt::Point aPagePos;
2719 awt::Size aPreferredPageSize;
2721 if (bIsSwSrcView || bPrintProspect)
2738 aTmpSize = pPrinter->GetPaperSize();
2740 pPrinter->GetMapMode(),
MapMode( MapUnit::Map100thMM ));
2741 aPageSize = awt::Size( aTmpSize.
Width(), aTmpSize.
Height() );
2750 aTmpSize = pVwSh->GetPageSize( nPage, bIsSkipEmptyPages );
2755 if( bPrintProspect )
2761 if( aPageSize.Width < aPageSize.Height )
2763 aPreferredPageSize.Width = aPageSize.Height;
2764 aPreferredPageSize.Height = aPageSize.Width;
2782 aTmpSize = pVwSh->
GetPageSize( nPage, bIsSkipEmptyPages );
2794 if (aPreferredPageSize.Width && aPreferredPageSize.Height)
2797 aRenderer.realloc( nLen );
2798 auto pRenderer = aRenderer.getArray();
2799 pRenderer[ nLen - 1 ].Name =
"PreferredPageSize";
2800 pRenderer[ nLen - 1 ].Value <<= aPreferredPageSize;
2802 if (nPrinterPaperTray >= 0)
2805 aRenderer.realloc( nLen );
2806 auto pRenderer = aRenderer.getArray();
2807 pRenderer[ nLen - 1 ].Name =
"PrinterPaperTray";
2808 pRenderer[ nLen - 1 ].Value <<= nPrinterPaperTray;
2817 if ( pPagePrintSettings &&
2818 ( pPagePrintSettings->
GetRow() > 1 ||
2819 pPagePrintSettings->
GetCol() > 1 ) )
2822 sal_Int32 nLen = aRenderer.getLength();
2823 const sal_Int32 nRenderDataIdxStart = nLen;
2825 aRenderer.realloc( nLen );
2826 auto pRenderer = aRenderer.getArray();
2828 const sal_Int32 nRow = pPagePrintSettings->
GetRow();
2829 pRenderer[ nRenderDataIdxStart + 0 ].Name =
"NUpRows";
2830 pRenderer[ nRenderDataIdxStart + 0 ].Value <<= std::max<sal_Int32>( nRow, 1);
2831 const sal_Int32 nCol = pPagePrintSettings->
GetCol();
2832 pRenderer[ nRenderDataIdxStart + 1 ].Name =
"NUpColumns";
2833 pRenderer[ nRenderDataIdxStart + 1 ].Value <<= std::max<sal_Int32>( nCol, 1);
2834 pRenderer[ nRenderDataIdxStart + 2 ].Name =
"NUpPageMarginLeft";
2835 pRenderer[ nRenderDataIdxStart + 2 ].Value <<= pPagePrintSettings->
GetLeftSpace();
2836 pRenderer[ nRenderDataIdxStart + 3 ].Name =
"NUpPageMarginRight";
2837 pRenderer[ nRenderDataIdxStart + 3 ].Value <<= pPagePrintSettings->
GetRightSpace();
2838 pRenderer[ nRenderDataIdxStart + 4 ].Name =
"NUpPageMarginTop";
2839 pRenderer[ nRenderDataIdxStart + 4 ].Value <<= pPagePrintSettings->
GetTopSpace();
2840 pRenderer[ nRenderDataIdxStart + 5 ].Name =
"NUpPageMarginBottom";
2841 pRenderer[ nRenderDataIdxStart + 5 ].Value <<= pPagePrintSettings->
GetBottomSpace();
2842 pRenderer[ nRenderDataIdxStart + 6 ].Name =
"NUpHorizontalSpacing";
2843 pRenderer[ nRenderDataIdxStart + 6 ].Value <<= pPagePrintSettings->
GetHorzSpace();
2844 pRenderer[ nRenderDataIdxStart + 7 ].Name =
"NUpVerticalSpacing";
2845 pRenderer[ nRenderDataIdxStart + 7 ].Value <<= pPagePrintSettings->
GetVertSpace();
2850 awt::Size aNewPageSize;
2852 aNewPageSize = awt::Size( aPageSize.
Width(), aPageSize.
Height() );
2858 aNewPageSize = awt::Size( aPageSize.
Height(), aPageSize.
Width() );
2860 pRenderer[ nRenderDataIdxStart + 8 ].Name =
"NUpPaperSize";
2861 pRenderer[ nRenderDataIdxStart + 8 ].Value <<= aNewPageSize;
2875 bool &rbIsSwSrcView,
2876 const uno::Reference< css::frame::XController >& rController )
2882 SwView *pSwView =
nullptr;
2893 pSwView =
dynamic_cast< SwView *
>(pView);
2894 pSwSrcView =
dynamic_cast< SwSrcView *
>(pView);
2895 if (!pSwPagePreview)
2897 if (rController.is())
2902 else if (pSwView || pSwSrcView)
2907 OSL_ENSURE( pSwView || pSwPagePreview || pSwSrcView,
"failed to get view shell" );
2909 rbIsSwSrcView = pSwSrcView !=
nullptr;
2914 sal_Int32 nRenderer,
2916 const uno::Sequence< beans::PropertyValue >& rxOptions )
2921 throw DisposedException( OUString(),
2922 static_cast< XTextDocument*
>(
this) );
2929 throw IllegalArgumentException();
2934 const bool bHasPDFExtOutDevData =
lcl_SeqHasProperty( rxOptions,
"HasPDFExtOutDevData" );
2935 const bool bIsPDFExport = !
lcl_SeqHasProperty( rxOptions,
"IsPrinter" ) || bHasPDFExtOutDevData;
2936 bool bIsSwSrcView =
false;
2939 OSL_ENSURE(
m_pRenderData,
"data should have been created already in getRendererCount..." );
2940 OSL_ENSURE(
m_pPrintUIOptions,
"data should have been created already in getRendererCount..." );
2950 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2953 sal_Int32 nMaxRenderer = 0;
2957 nMaxRenderer = bPrintProspect?
2958 m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
2963 if (bIsSwSrcView || nRenderer <= nMaxRenderer)
2969 rSwSrcView.
PrintSource(pOutDev, nRenderer + 1,
false);
2977 const SwView* pSwView =
dynamic_cast<const SwView*
>(pView);
2994 "SwView / SwViewOptionAdjust_Impl availability mismatch" );
3017 if (bIsPDFExport && (bFirstPage || bHasPDFExtOutDevData) && pWrtShell)
3033 if (bIsPDFExport && bLastPage && pWrtShell)
3080 throw DisposedException( OUString(),
static_cast< XTextDocument*
>(
this ) );
3090 throw DisposedException(
"SwXTextDocument not valid",
3091 static_cast<XTextDocument*
>(
this));
3102 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
3109 uno::Reference< frame::XModel > xNewModel = pShell->GetModel();
3111 uno::Sequence< beans::PropertyValue > aTempMediaDescriptor;
3112 storeToStorage( xNewStorage, aTempMediaDescriptor );
3113 uno::Reference< document::XStorageBasedDocument > xStorageDoc( xNewModel, uno::UNO_QUERY );
3114 xStorageDoc->loadFromStorage( xNewStorage, aTempMediaDescriptor );
3115 return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY );
3122 if (
IsValid() && xListener.is())
3127 const uno::Reference<text::XPasteListener>& xListener)
3131 if (
IsValid() && xListener.is())
3136 int nOutputWidth,
int nOutputHeight,
3137 int nTilePosX,
int nTilePosY,
3141 pViewShell->
PaintTile(rDevice, nOutputWidth, nOutputHeight,
3142 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3145 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3154 Size aOutputSize(nOutputWidth, nOutputHeight);
3176 pWrtShell->
GotoPage(nPart + 1,
true);
3221 if (pSdrView->GetTextEditObject())
3234 pView->ForcePageUpDownOffset(2 * rRectangle.
GetHeight() / 3);
3239 pViewShell->setLOKVisibleArea(rRectangle);
3244 int nTileTwipWidth_,
int )
3255 double fScale = 100.0 * nTilePixelWidth_ / nTileTwipWidth_
3258 if (aOption.
GetZoom() != fScale)
3275 return PointerStyle::Arrow;
3282 auto redlinesNode = rJson.
startArray(
"redlines");
3285 static bool bDisableRedlineComments = getenv(
"DISABLE_REDLINE") !=
nullptr;
3286 if (bDisableRedlineComments)
3294 rJson.
put(
"index", rRedlineTable[
i]->
GetId());
3295 rJson.
put(
"author", rRedlineTable[
i]->GetAuthorString(1));
3297 rRedlineTable[
i]->GetRedlineData().GetType()));
3298 rJson.
put(
"comment",
3299 rRedlineTable[
i]->GetRedlineData().GetComment());
3300 rJson.
put(
"description", rRedlineTable[
i]->GetDescr());
3302 rRedlineTable[
i]->GetRedlineData().GetTimeStamp().GetUNODateTime());
3303 rJson.
put(
"dateTime", sDateTime);
3305 SwContentNode* pContentNd = rRedlineTable[
i]->GetPointContentNode();
3307 if (pView && pContentNd)
3311 aCursor.
GetMark()->
Assign(*pContentNd, rRedlineTable[
i]->
End()->GetContentIndex());
3316 std::vector<OString> aRects;
3317 for (
const SwRect& rNextRect : *pRects)
3318 aRects.push_back(rNextRect.SVRect().toString());
3321 rJson.
put(
"textRange", sRects);
3328 SW_MOD()->GetRedlineAuthorInfo(rJsonWriter);
3340 auto commentsNode = rJsonWriter.
startArray(
"comments");
3354 aRect.
Pos().getX() + aRect.
SSize().Width(),
3355 aRect.
Pos().getY() + aRect.
SSize().Height());
3357 if (!sidebarItem->maLayoutInfo.mPositionFromCommentAnchor)
3363 std::vector<OString> aRects;
3366 const SwRect rect(aRange.getMinX(), aRange.getMinY(), aRange.getWidth(), aRange.getHeight());
3375 rJsonWriter.
put(
"author", pField->
GetPar1());
3377 rJsonWriter.
put(
"resolved", pField->
GetResolved() ?
"true" :
"false");
3380 rJsonWriter.
put(
"textRange", sRects);
3387 if (aIter ==
aArguments.end() || aIter->second !=
"drop-down")
3391 if (aIter ==
aArguments.end() || aIter->second !=
"selected")
3398 sal_Int32 nSelection = aIter->second.toInt32();
3408 if (nSelection >= 0)
3411 pFieldBM->Invalidate();
3418std::vector<basegfx::B2DRange>
3423 return std::vector<basegfx::B2DRange>();
3431 return std::vector<basegfx::B2DRange>();
3436 OStringBuffer aState;
3450 aState.append(aThemeName);
3453 return aState.makeStringAndClear();
3458inline constexpr OUStringLiteral SELECTED_DATE_FORMAT =
u"YYYY-MM-DD";
3463 auto it = rArguments.find(
"type");
3464 if (it == rArguments.end())
3469 if (it->second ==
"drop-down")
3486 auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
3488 std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.
GetContentControl();
3489 if (!pContentControl->GetComboBox() && !pContentControl->GetDropDown())
3494 it = rArguments.find(
"selected");
3495 if (it == rArguments.end())
3500 sal_Int32 nSelection = it->second.toInt32();
3501 pContentControl->SetSelectedListItem(nSelection);
3504 else if (it->second ==
"picture")
3506 it = rArguments.find(
"changed");
3507 if (it == rArguments.end())
3521 SfxCallMode::SYNCHRON, { &aItem });
3523 else if (it->second ==
"date")
3540 auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
3543 std::shared_ptr<SwContentControl> pContentControl
3545 if (!pContentControl->GetDate())
3550 it = rArguments.find(
"selected");
3551 if (it == rArguments.end())
3556 OUString aSelectedDate = it->second.replaceAll(
"T00:00:00Z",
"");
3563 sal_Int32 nCheckPos = 0;
3565 OUString sFormat = SELECTED_DATE_FORMAT;
3574 double dCurrentDate = 0;
3575 pNumberFormatter->
IsNumberFormat(aSelectedDate, nFormat, dCurrentDate);
3576 pContentControl->SetSelectedDate(dCurrentDate);
3594 return SwResId(STR_PAGE) + OUString::number(nPart + 1);
3599 OUString sPart(
SwResId(STR_PAGE) + OUString::number(nPart + 1));
3601 return OUString::number(sPart.hashCode());
3640 OUString sOrigAuthor =
SW_MOD()->GetRedlineAuthor(
SW_MOD()->GetRedlineAuthor());
3643 for (
const beans::PropertyValue& rValue : rArguments)
3645 if (rValue.Name ==
".uno:HideWhitespace" && rValue.Value.has<
bool>())
3647 else if (rValue.Name ==
".uno:ShowBorderShadow" && rValue.Value.has<
bool>())
3649 else if (rValue.Name ==
".uno:Author" && rValue.Value.has<OUString>())
3651 sAuthor = rValue.Value.get<OUString>();
3659 else if (rValue.Name ==
".uno:SpellOnline" && rValue.Value.has<
bool>())
3663 if (!sAuthor.isEmpty() && sAuthor != sOrigAuthor)
3670 pShell->SwViewShell::UpdateFields(
true);
3671 pShell->ResetModified();
3699 officecfg::Office::Common::Save::Document::WarnAlienFormat::set(
false, xChanges);
3739 Point aPointTwip(nX, nY);
3745 MouseEventModifiers::SIMPLECLICK,
3746 nButtons, nModifier);
3762 case LOK_SETTEXTSELECTION_START:
3765 case LOK_SETTEXTSELECTION_END:
3768 case LOK_SETTEXTSELECTION_RESET:
3781 uno::Reference<datatransfer::XTransferable> xTransferable;
3786 if (pSdrView->GetTextEditObject())
3789 EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView();
3799 EditView& rEditView = pWin->GetOutlinerView()->GetEditView();
3804 if (!xTransferable.is() && pWrtShell)
3807 return xTransferable;
3826 case LOK_SETGRAPHICSELECTION_START:
3829 case LOK_SETGRAPHICSELECTION_END:
3846void SAL_CALL
SwXTextDocument::paintTile( const ::css::uno::Any& Parent, ::sal_Int32 nOutputWidth, ::sal_Int32 nOutputHeight, ::sal_Int32 nTilePosX, ::sal_Int32 nTilePosY, ::sal_Int32 nTileWidth, ::sal_Int32 nTileHeight )
3851 sal_Int64 nWindowHandle;
3852 Parent >>= nWindowHandle;
3853 aData.hWnd =
reinterpret_cast<HWND
>(nWindowHandle);
3855 paintTile(*xDevice, nOutputWidth, nOutputHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3860 (void)nOutputHeight;
3872 ::sal_Int16 nScriptTypes,
3873 ::sal_Int16 nMaxCount )
3879 const sal_Int16 nLatin = 0x001;
3880 const sal_Int16 nAsian = 0x002;
3881 const sal_Int16 nComplex = 0x004;
3884 const bool bLatin = 0 != (nScriptTypes & nLatin);
3885 const bool bAsian = 0 != (nScriptTypes & nAsian);
3886 const bool bComplex = 0 != (nScriptTypes & nComplex);
3888 if (nScriptTypes < nLatin || nScriptTypes > (nLatin | nAsian | nComplex))
3889 throw IllegalArgumentException(
"nScriptTypes ranges from 1 to 7!", Reference< XInterface >(), 1);
3891 throw DisposedException();
3895 std::set< LanguageType > aAllLangs;
3900 for(
size_t i = 0;
i < pFormats->
size(); ++
i)
3902 const SwAttrSet &rAttrSet = (*pFormats)[
i]->GetAttrSet();
3908 aAllLangs.insert(
nLang );
3914 aAllLangs.insert(
nLang );
3920 aAllLangs.insert(
nLang );
3925 for (
size_t i = 0;
i < pColls->
size(); ++
i)
3927 const SwAttrSet &rAttrSet = (*pColls)[
i]->GetAttrSet();
3933 aAllLangs.insert(
nLang );
3939 aAllLangs.insert(
nLang );
3945 aAllLangs.insert(
nLang );
3957 std::vector< std::shared_ptr<SfxItemSet> > rStyles;
3959 while (!rStyles.empty())
3961 std::shared_ptr<SfxItemSet> pStyle = rStyles.back();
3971 aAllLangs.insert(
nLang );
3978 aAllLangs.insert(
nLang );
3985 aAllLangs.insert(
nLang );
4000 sal_Int32 nParCount = pOutliner->GetParagraphCount();
4001 for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
4004 std::vector<sal_Int32> aPortions;
4007 for (
size_t nPos = aPortions.size();
nPos; )
4011 sal_Int32 nEnd = aPortions[
nPos ];
4012 sal_Int32 nStart =
nPos ? aPortions[
nPos - 1 ] : 0;
4013 ESelection aSelection( nPar, nStart, nPar, nEnd );
4021 aAllLangs.insert(
nLang );
4027 aAllLangs.insert(
nLang );
4033 aAllLangs.insert(
nLang );
4040 if (nMaxCount >
static_cast< sal_Int16
>( aAllLangs.size() ))
4041 nMaxCount =
static_cast< sal_Int16
>( aAllLangs.size() );
4044 uno::Sequence< lang::Locale > aLanguages( nMaxCount );
4045 lang::Locale* pLanguage = aLanguages.getArray();
4049 for (
const auto& rLang : aAllLangs)
4094 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4101 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4108 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4115 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4122 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4129 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4136 aRet <<= Reference< XPropertySet >(xBkms, UNO_QUERY);
4143 aRet <<= Reference<XPropertySet>(xDrawingObjects, UNO_QUERY);
4146 throw NoSuchElementException();
4189 return "SwXLinkTargetSupplier";
4199 Sequence< OUString > aRet {
"com.sun.star.document.LinkTargets" };
4204 Reference< XNameAccess >
const & xAccess, OUString aLinkDisplayName, OUString sSuffix ) :
4205 m_xRealAccess(xAccess),
4208 m_sLinkDisplayName(
std::move(aLinkDisplayName)),
4214 OUString aLinkDisplayName, OUString sSuffix) :
4217 m_sLinkDisplayName(
std::move(aLinkDisplayName)),
4229 bool bFound =
false;
4231 OUString sParam = rName;
4233 if(sParam.getLength() >
sSuffix.getLength() )
4235 std::u16string_view sCmp = sParam.subView(sParam.getLength() -
sSuffix.getLength(),
4241 sParam = sParam.copy(0, sParam.getLength() -
sSuffix.getLength());
4250 for (
size_t i = 0;
i < nOutlineCount && !bFound; ++
i)
4254 OUString sOutlineText =
4258 Reference<XPropertySet> xOutline =
4265 else if (
sSuffix ==
"|drawingobject")
4274 if (sParam == pObj->
GetName())
4277 aRet <<= xDrawingObject;
4287 Reference< XInterface > xInt;
4288 if(!(aRet >>= xInt))
4290 Reference< XPropertySet > xProp(xInt, UNO_QUERY);
4297 throw NoSuchElementException();
4303 Sequence< OUString > aRet;
4312 const size_t nOutlineCount = rOutlineNodes.
size();
4313 aRet.realloc(nOutlineCount);
4314 OUString* pResArr = aRet.getArray();
4315 for (
size_t i = 0;
i < nOutlineCount; ++
i)
4318 pResArr[
i] = sEntry;
4328 aRet.realloc(nObjCount);
4329 OUString* pResArr = aRet.getArray();
4331 for (
size_t i = 0;
i < nObjCount; ++
i)
4334 if (!pObj->
GetName().isEmpty())
4335 pResArr[j++] = pObj->
GetName() +
"|drawingobject";
4342 const Sequence< OUString > aOrg =
m_xRealAccess->getElementNames();
4343 aRet.realloc(aOrg.getLength());
4344 std::transform(aOrg.begin(), aOrg.end(), aRet.getArray(),
4345 [
this](
const OUString& rOrg) -> OUString { return rOrg + m_sLinkSuffix; });
4353 OUString sParam(rName);
4356 std::u16string_view sCmp = sParam.subView(sParam.getLength() -
m_sLinkSuffix.getLength(),
4360 sParam = sParam.copy(0, sParam.getLength() -
m_sLinkSuffix.getLength());
4370 for (
size_t i = 0;
i < nOutlineCount && !bRet; ++
i)
4385 for (
size_t i = 0;
i < nObjCount && !bRet; ++
i)
4412 OSL_FAIL(
"not implemented");
4428 const OUString& rPropName,
const Any& )
4430 throw UnknownPropertyException(rPropName);
4436 if(!sLinkSuffix.empty())
4437 sLinkSuffix = sLinkSuffix.substr(1);
4440 if(sLinkSuffix ==
u"outline")
4441 sImgId = RID_BMP_NAVI_OUTLINE;
4442 else if(sLinkSuffix ==
u"table")
4443 sImgId = RID_BMP_NAVI_TABLE;
4444 else if(sLinkSuffix ==
u"frame")
4445 sImgId = RID_BMP_NAVI_FRAME;
4446 else if(sLinkSuffix ==
u"graphic")
4447 sImgId = RID_BMP_NAVI_GRAPHIC;
4448 else if(sLinkSuffix ==
u"ole")
4449 sImgId = RID_BMP_NAVI_OLE;
4450 else if(sLinkSuffix.empty())
4451 sImgId = RID_BMP_NAVI_BOOKMARK;
4452 else if(sLinkSuffix ==
u"region")
4453 sImgId = RID_BMP_NAVI_REGION;
4454 else if(sLinkSuffix ==
u"drawingobject")
4455 sImgId = RID_BMP_NAVI_DRAWOBJECT;
4457 if (!sImgId.isEmpty())
4476 throw UnknownPropertyException(rPropertyName);
4481 const OUString& ,
const Reference< XPropertyChangeListener > & )
4485 const OUString& ,
const Reference< XPropertyChangeListener > & )
4489 const OUString& ,
const Reference< XVetoableChangeListener > & )
4493 const OUString& ,
const Reference< XVetoableChangeListener > & )
4503 return "SwXLinkNameAccessWrapper";
4513 Sequence< OUString > aRet {
"com.sun.star.document.LinkTargets" };
4518 const sal_Int32 nOutlineLevel) :
4520 m_sOutlineText(
std::move(aOutlineText)),
4521 m_sActualText(
std::move(aActualText)),
4522 m_nOutlineLevel(nOutlineLevel)
4537 const OUString& rPropertyName,
const Any& )
4539 throw UnknownPropertyException(rPropertyName);
4545 rPropertyName !=
"OutlineLevel")
4546 throw UnknownPropertyException(rPropertyName);
4548 if (rPropertyName ==
"ActualOutlineName")
4551 if (rPropertyName ==
"OutlineLevel")
4558 const OUString& ,
const Reference< XPropertyChangeListener > & )
4563 const OUString& ,
const Reference< XPropertyChangeListener > & )
4568 const OUString& ,
const Reference< XVetoableChangeListener > & )
4573 const OUString& ,
const Reference< XVetoableChangeListener > & )
4579 return "SwXOutlineTarget";
4589 Sequence<OUString> aRet {
"com.sun.star.document.LinkTarget" };
4596 m_sDrawingObjectText(
std::move(aDrawingObjectText))
4611 const OUString& rPropertyName,
const Any& )
4613 throw UnknownPropertyException(rPropertyName);
4619 throw UnknownPropertyException(rPropertyName);
4625 const OUString& ,
const Reference< XPropertyChangeListener > & )
4630 const OUString& ,
const Reference< XPropertyChangeListener > & )
4635 const OUString& ,
const Reference< XVetoableChangeListener > & )
4640 const OUString& ,
const Reference< XVetoableChangeListener > & )
4646 return "SwXDrawingObjectTarget";
4656 Sequence<OUString> aRet {
"com.sun.star.document.LinkTarget" };
4673 Reference<XInterface> xRet;
4715#if OSL_DEBUG_LEVEL > 0
4716 default: OSL_FAIL(
"which table?");
4745 , m_aOldViewOptions( rViewOptions )
4764 const bool bContainsHiddenFields = pFieldType && pFieldType->HasWriterListeners();
4766 const bool bContainsHiddenParagraphs = pFieldType && pFieldType->HasWriterListeners();
4768 const bool bContainsPlaceHolders = pFieldType && pFieldType->HasWriterListeners();
4778 aRenderViewOptions.
SetBlank(
false );
4780 aRenderViewOptions.
SetTab(
false );
4786 if (bContainsHiddenChars)
4788 if (bContainsHiddenFields)
4790 if (bContainsHiddenParagraphs)
4793 if (bContainsPlaceHolders)
4800 if (bContainsFields)
4809 aRenderViewOptions.
SetPrinting( pPrtOptions !=
nullptr );
@ ShowDelete
show all deletes
@ ShowInsert
show all inserts
OUString SwRedlineTypeToOUString(RedlineType eType)
constexpr auto convertTwipToMm100(N n)
css::util::DateTime GetUNODateTime() const
void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList)
css::uno::Reference< css::datatransfer::XTransferable > CreateTransferable(const ESelection &rSelection) const
SfxItemSet GetAttribs(sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags=GetAttribsFlags::ALL) const
static bool HasValidData(const css::uno::Reference< css::datatransfer::XTransferable > &rTransferable)
ESelection GetSelection() const
EditEngine * GetEditEngine() const
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual void setPrintData(const SwPrintData &rPrtData)=0
Sets the PrintData.
virtual const SwPrintData & getPrintData() const =0
Returns the PrintData.
virtual SwDrawModel * GetOrCreateDrawModel()=0
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual bool SetFieldsDirty(bool b, const SwNode *pChk, SwNodeOffset nLen)=0
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual sfx2::LinkManager & GetLinkManager()=0
virtual sw::mark::IFieldmark * getInnerFieldmarkFor(const SwPosition &pos) const =0
virtual OUString getOutlineText(const tSortedOutlineNodeList::size_type nIdx, SwRootFrame const *pLayout, const bool bWithNumber=true, const bool bWithSpacesForLevel=false, const bool bWithFootnote=true) const =0
virtual int getOutlineLevel(const tSortedOutlineNodeList::size_type nIdx) const =0
virtual void SetRedlinePassword(const css::uno::Sequence< sal_Int8 > &rNewPassword)=0
static bool IsShowChanges(const RedlineFlags eM)
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const =0
virtual void SetModified()=0
Must be called manually at changes of format.
virtual const SwDocStat & GetUpdatedDocStat(bool bCompleteAsync, bool bFields)=0
Updates the document statistics if the document has been modified and returns a reference to the resu...
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
virtual void BlockIdling()=0
Increment block count.
virtual void UnblockIdling()=0
Decrement block count.
virtual void getAllStyles(std::vector< std::shared_ptr< SfxItemSet > > &rStyles, SwAutoStyleFamily eFamily)=0
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
bool setGraphicSelection(int nType, int nX, int nY, double fScaleX=1.0, double fScaleY=1.0)
bool setTextSelection(int nType, int nX, int nY)
static void PaintAllChartsOnTile(VirtualDevice &rDevice, int nOutputWidth, int nOutputHeight, int nTilePosX, int nTilePosY, tools::Long nTileWidth, tools::Long nTileHeight, bool bNegativeX=false)
static void paintControlTile(const SdrPage *pPage, const SdrView *pDrawView, vcl::Window const &rMainWindow, VirtualDevice &rDevice, Size aOutputSize, tools::Rectangle const &rTileRect)
static bool postMouseEvent(const SdrPage *pPage, const SdrView *pDrawView, vcl::DocWindow &rMainWindow, int nType, Point aPointHmm, int nCount, int nButtons, int nModifier)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
constexpr tools::Long Y() const
constexpr tools::Long X() const
const Size & GetPaperSizePixel() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
const SdrOutliner * GetTextEditOutliner() const
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
virtual const OUString & GetName() const
virtual sal_Bool SAL_CALL attachResource(const OUString &sURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
virtual void SAL_CALL close(sal_Bool bDeliverOwnership) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL connectController(const css::uno::Reference< css::frame::XController > &xController) override
virtual void SAL_CALL setCurrentController(const css::uno::Reference< css::frame::XController > &xController) override
virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController() override
virtual OUString SAL_CALL getURL() override
virtual void SAL_CALL disconnectController(const css::uno::Reference< css::frame::XController > &xController) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL acquire() noexcept override
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL dispose() override
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
const SfxItemPropertyMap & getPropertyMap() const
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static void postKeyEventAsync(const VclPtr< vcl::Window > &xWindow, int nType, int nCharCode, int nKeyCode, int nRepeat=0)
static bool testInPlaceComponentMouseEventHit(SfxViewShell *pViewShell, int nType, int nX, int nY, int nCount, int nButtons, int nModifier, double fScaleX, double fScaleY, bool bNegativeX=false)
static VclPtr< vcl::Window > getInPlaceDocWindow(SfxViewShell *pViewShell)
static void postMouseEventAsync(const VclPtr< vcl::Window > &xWindow, LokMouseEventData const &rLokMouseEventData)
SfxItemSet & GetItemSet() const