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));
1975 throw UnknownPropertyException(rPropertyName);
1977 switch(pEntry->
nWID)
1988 switch(pEntry->
nWID)
1999 aAny <<=
SW_MOD()->GetDocStatWordDelim();
2028 aAny <<=
SW_MOD()->GetModuleConfig()->IsHideFieldTips();
2038 nRet = RedlineDisplayType::REMOVED;
2040 nRet = RedlineDisplayType::INSERTED_AND_REMOVED;
2060 if (
nullptr != pDrawDoc )
2071 if (
nullptr != pDrawDoc )
2091 aAny <<= OUString(
"ThisWordDoc" );
2095 aAny <<= getRuntimeUID();
2104 aAny <<= hasValidSignatures();
2107 getGrabBagItem(aAny);
2120 const Reference< XPropertyChangeListener > & )
2122 OSL_FAIL(
"not implemented");
2126 const Reference< XPropertyChangeListener > & )
2128 OSL_FAIL(
"not implemented");
2132 const Reference< XVetoableChangeListener > & )
2134 OSL_FAIL(
"not implemented");
2138 const Reference< XVetoableChangeListener > & )
2140 OSL_FAIL(
"not implemented");
2166 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2167 m_pImpl->m_RefreshListeners.notifyEach(aGuard,
2168 & util::XRefreshListener::refreshed, ev);
2175 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2184 const Reference<util::XRefreshListener> & xListener)
2188 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2189 m_pImpl->m_RefreshListeners.addInterface(aGuard, xListener);
2194 const Reference<util::XRefreshListener> & xListener)
2198 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2199 m_pImpl->m_RefreshListeners.removeInterface(aGuard, xListener);
2207 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2223 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2227 throw UnknownPropertyException(rPropertyName);
2228 return PropertyState_DIRECT_VALUE;
2233 const sal_Int32
nCount = rPropertyNames.getLength();
2234 Sequence < PropertyState > aRet (
nCount );
2236 std::transform(rPropertyNames.begin(), rPropertyNames.end(), aRet.getArray(),
2237 [
this](
const OUString& rName) -> PropertyState { return getPropertyState(rName); });
2246 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2250 throw UnknownPropertyException(rPropertyName);
2251 switch(pEntry->
nWID)
2253 case 0:
default:
break;
2261 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2265 throw UnknownPropertyException(rPropertyName);
2267 switch(pEntry->
nWID)
2269 case 0:
default:
break;
2279 uno::Reference< awt::XDevice > xRenderDevice;
2280 aAny >>= xRenderDevice;
2281 if (xRenderDevice.is())
2291 const uno::Sequence< beans::PropertyValue >& rOptions,
2292 const char *pPropName )
2294 return std::any_of(rOptions.begin(), rOptions.end(),
2295 [&pPropName](
const beans::PropertyValue& rProp) {
2296 return rProp.Name.equalsAscii( pPropName ); });
2300 const uno::Sequence< beans::PropertyValue >& rOptions,
2301 const char *pPropName )
2304 auto pOption = std::find_if(rOptions.begin(), rOptions.end(),
2305 [&pPropName](
const beans::PropertyValue& rProp) {
2306 return rProp.Name.equalsAscii( pPropName ); });
2307 if (pOption != rOptions.end())
2308 pOption->Value >>= bRes;
2313 bool &rbIsSwSrcView,
2314 const uno::Sequence< beans::PropertyValue >& rOptions,
2324 auto pOption = std::find_if(rOptions.begin(), rOptions.end(),
2325 [](
const beans::PropertyValue& rProp) { return rProp.Name ==
"View"; });
2326 if (pOption != rOptions.end())
2327 aTmp = pOption->
Value;
2332 OSL_ENSURE(
xController.is(),
"controller is empty!" );
2352 SwDoc *pDoc =
nullptr;
2354 uno::Reference< frame::XModel >
xModel;
2360 OSL_ENSURE( !
xModel.is(),
"unexpected model found" );
2369 bool bIsSwSrcView =
false;
2371 OSL_ENSURE( bIsPDFExport,
"view is missing, guessing one..." );
2375 OSL_ENSURE( rpView,
"SwViewShell missing" );
2379 if (
auto pSwView =
dynamic_cast<SwView *
>( rpView ))
2383 OSL_FAIL(
"GetRenderDoc: no renderdata");
2389 xDocSh = pSwView->CreateTmpSelectionDoc();
2394 pDoc =
static_cast<SwDocShell*
>(&xDocSh)->GetDoc();
2400 OSL_FAIL(
"unexpected SwViewShell" );
2438 const uno::Sequence< beans::PropertyValue >& rxOptions )
2443 throw DisposedException( OUString(),
2444 static_cast< XTextDocument*
>(
this) );
2448 bool bIsSwSrcView =
false;
2458 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2459 if (!pDoc || !pView)
2470 nRet = rSwSrcView.
PrintSource( pOutDev, 1 ,
true );
2485 if ( bIsPDFExport && bFormat )
2493 pViewShell =
static_cast<SwPagePreview*
>(pView)->GetViewShell();
2496 if (!pViewShell || !pViewShell->
GetLayout())
2539 bool setShowPlaceHoldersInPDF =
false;
2542 m_pRenderData->ViewOptionAdjust( pPrtOptions, setShowPlaceHoldersInPDF );
2555 bool bStateChanged =
false;
2560 bStateChanged =
true;
2562 pViewShell->SwViewShell::UpdateFields(
true);
2574 const sal_Int32 nPageCount = pViewShell->
GetPageCount();
2582 nRet =
m_pRenderData->GetPagePairsForProspectPrinting().size();
2606 OSL_ENSURE( nRet >= 0,
"negative number of pages???" );
2616 sal_Int32 nRenderer,
2618 const uno::Sequence< beans::PropertyValue >& rxOptions )
2623 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2627 bool bIsSwSrcView =
false;
2641 const bool bIsSkipEmptyPages = !
m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport );
2642 const bool bPrintPaperFromSetup =
m_pPrintUIOptions->getBoolValue(
"PrintPaperFromSetup" );
2645 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2646 if (!pDoc || !pView)
2647 return uno::Sequence< beans::PropertyValue >();
2653 throw IllegalArgumentException();
2655 sal_Int32 nMaxRenderer = 0;
2659 nMaxRenderer = bPrintProspect?
2660 m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
2665 if (!bIsSwSrcView &&
m_pRenderData && nRenderer > nMaxRenderer)
2666 return uno::Sequence< beans::PropertyValue >();
2668 uno::Sequence< beans::PropertyValue > aRenderer;
2675 const sal_Int32 nPage = bPrintProspect
2680 sal_Int32 nPrinterPaperTray = -1;
2681 if (! bPrintPaperFromSetup)
2684 const std::map< sal_Int32, sal_Int32 > &rPaperTrays =
m_pRenderData->GetPrinterPaperTrays();
2685 std::map< sal_Int32, sal_Int32 >::const_iterator aIt( rPaperTrays.find( nPage ) );
2686 if (aIt != rPaperTrays.end())
2687 nPrinterPaperTray = aIt->second;
2690 awt::Size aPageSize;
2691 awt::Point aPagePos;
2692 awt::Size aPreferredPageSize;
2694 if (bIsSwSrcView || bPrintProspect)
2711 aTmpSize = pPrinter->GetPaperSize();
2713 pPrinter->GetMapMode(),
MapMode( MapUnit::Map100thMM ));
2714 aPageSize = awt::Size( aTmpSize.
Width(), aTmpSize.
Height() );
2723 aTmpSize = pVwSh->GetPageSize( nPage, bIsSkipEmptyPages );
2728 if( bPrintProspect )
2734 if( aPageSize.Width < aPageSize.Height )
2736 aPreferredPageSize.Width = aPageSize.Height;
2737 aPreferredPageSize.Height = aPageSize.Width;
2755 aTmpSize = pVwSh->
GetPageSize( nPage, bIsSkipEmptyPages );
2767 if (aPreferredPageSize.Width && aPreferredPageSize.Height)
2770 aRenderer.realloc( nLen );
2771 auto pRenderer = aRenderer.getArray();
2772 pRenderer[ nLen - 1 ].Name =
"PreferredPageSize";
2773 pRenderer[ nLen - 1 ].Value <<= aPreferredPageSize;
2775 if (nPrinterPaperTray >= 0)
2778 aRenderer.realloc( nLen );
2779 auto pRenderer = aRenderer.getArray();
2780 pRenderer[ nLen - 1 ].Name =
"PrinterPaperTray";
2781 pRenderer[ nLen - 1 ].Value <<= nPrinterPaperTray;
2790 if ( pPagePrintSettings &&
2791 ( pPagePrintSettings->
GetRow() > 1 ||
2792 pPagePrintSettings->
GetCol() > 1 ) )
2795 sal_Int32 nLen = aRenderer.getLength();
2796 const sal_Int32 nRenderDataIdxStart = nLen;
2798 aRenderer.realloc( nLen );
2799 auto pRenderer = aRenderer.getArray();
2801 const sal_Int32 nRow = pPagePrintSettings->
GetRow();
2802 pRenderer[ nRenderDataIdxStart + 0 ].Name =
"NUpRows";
2803 pRenderer[ nRenderDataIdxStart + 0 ].Value <<= std::max<sal_Int32>( nRow, 1);
2804 const sal_Int32 nCol = pPagePrintSettings->
GetCol();
2805 pRenderer[ nRenderDataIdxStart + 1 ].Name =
"NUpColumns";
2806 pRenderer[ nRenderDataIdxStart + 1 ].Value <<= std::max<sal_Int32>( nCol, 1);
2807 pRenderer[ nRenderDataIdxStart + 2 ].Name =
"NUpPageMarginLeft";
2808 pRenderer[ nRenderDataIdxStart + 2 ].Value <<= pPagePrintSettings->
GetLeftSpace();
2809 pRenderer[ nRenderDataIdxStart + 3 ].Name =
"NUpPageMarginRight";
2810 pRenderer[ nRenderDataIdxStart + 3 ].Value <<= pPagePrintSettings->
GetRightSpace();
2811 pRenderer[ nRenderDataIdxStart + 4 ].Name =
"NUpPageMarginTop";
2812 pRenderer[ nRenderDataIdxStart + 4 ].Value <<= pPagePrintSettings->
GetTopSpace();
2813 pRenderer[ nRenderDataIdxStart + 5 ].Name =
"NUpPageMarginBottom";
2814 pRenderer[ nRenderDataIdxStart + 5 ].Value <<= pPagePrintSettings->
GetBottomSpace();
2815 pRenderer[ nRenderDataIdxStart + 6 ].Name =
"NUpHorizontalSpacing";
2816 pRenderer[ nRenderDataIdxStart + 6 ].Value <<= pPagePrintSettings->
GetHorzSpace();
2817 pRenderer[ nRenderDataIdxStart + 7 ].Name =
"NUpVerticalSpacing";
2818 pRenderer[ nRenderDataIdxStart + 7 ].Value <<= pPagePrintSettings->
GetVertSpace();
2823 awt::Size aNewPageSize;
2825 aNewPageSize = awt::Size( aPageSize.
Width(), aPageSize.
Height() );
2831 aNewPageSize = awt::Size( aPageSize.
Height(), aPageSize.
Width() );
2833 pRenderer[ nRenderDataIdxStart + 8 ].Name =
"NUpPaperSize";
2834 pRenderer[ nRenderDataIdxStart + 8 ].Value <<= aNewPageSize;
2848 bool &rbIsSwSrcView,
2849 const uno::Reference< css::frame::XController >& rController )
2855 SwView *pSwView =
nullptr;
2866 pSwView =
dynamic_cast< SwView *
>(pView);
2867 pSwSrcView =
dynamic_cast< SwSrcView *
>(pView);
2868 if (!pSwPagePreview)
2870 if (rController.is())
2875 else if (pSwView || pSwSrcView)
2880 OSL_ENSURE( pSwView || pSwPagePreview || pSwSrcView,
"failed to get view shell" );
2882 rbIsSwSrcView = pSwSrcView !=
nullptr;
2887 sal_Int32 nRenderer,
2889 const uno::Sequence< beans::PropertyValue >& rxOptions )
2894 throw DisposedException( OUString(),
2895 static_cast< XTextDocument*
>(
this) );
2902 throw IllegalArgumentException();
2907 const bool bHasPDFExtOutDevData =
lcl_SeqHasProperty( rxOptions,
"HasPDFExtOutDevData" );
2908 const bool bIsPDFExport = !
lcl_SeqHasProperty( rxOptions,
"IsPrinter" ) || bHasPDFExtOutDevData;
2909 bool bIsSwSrcView =
false;
2912 OSL_ENSURE(
m_pRenderData,
"data should have been created already in getRendererCount..." );
2913 OSL_ENSURE(
m_pPrintUIOptions,
"data should have been created already in getRendererCount..." );
2923 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2926 sal_Int32 nMaxRenderer = 0;
2930 nMaxRenderer = bPrintProspect?
2931 m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
2936 if (bIsSwSrcView || nRenderer <= nMaxRenderer)
2942 rSwSrcView.
PrintSource(pOutDev, nRenderer + 1,
false);
2950 const SwView* pSwView =
dynamic_cast<const SwView*
>(pView);
2967 "SwView / SwViewOptionAdjust_Impl availability mismatch" );
2983 if (bIsPDFExport && (bFirstPage || bHasPDFExtOutDevData) && pWrtShell)
3003 if (bIsPDFExport && bLastPage && pWrtShell)
3051 throw DisposedException( OUString(),
static_cast< XTextDocument*
>(
this ) );
3061 throw DisposedException(
"SwXTextDocument not valid",
3062 static_cast<XTextDocument*
>(
this));
3073 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
3080 uno::Reference< frame::XModel > xNewModel = pShell->GetModel();
3082 uno::Sequence< beans::PropertyValue > aTempMediaDescriptor;
3083 storeToStorage( xNewStorage, aTempMediaDescriptor );
3084 uno::Reference< document::XStorageBasedDocument > xStorageDoc( xNewModel, uno::UNO_QUERY );
3085 xStorageDoc->loadFromStorage( xNewStorage, aTempMediaDescriptor );
3086 return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY );
3093 if (
IsValid() && xListener.is())
3098 const uno::Reference<text::XPasteListener>& xListener)
3102 if (
IsValid() && xListener.is())
3107 int nOutputWidth,
int nOutputHeight,
3108 int nTilePosX,
int nTilePosY,
3112 pViewShell->
PaintTile(rDevice, nOutputWidth, nOutputHeight,
3113 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3116 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3125 Size aOutputSize(nOutputWidth, nOutputHeight);
3147 pWrtShell->
GotoPage(nPart + 1,
true);
3192 if (pSdrView->GetTextEditObject())
3205 pView->ForcePageUpDownOffset(2 * rRectangle.
GetHeight() / 3);
3210 pViewShell->setLOKVisibleArea(rRectangle);
3215 int nTileTwipWidth_,
int )
3226 double fScale = 100.0 * nTilePixelWidth_ / nTileTwipWidth_
3229 if (aOption.
GetZoom() != fScale)
3246 return PointerStyle::Arrow;
3253 auto redlinesNode = rJson.
startArray(
"redlines");
3256 static bool bDisableRedlineComments = getenv(
"DISABLE_REDLINE") !=
nullptr;
3257 if (bDisableRedlineComments)
3265 rJson.
put(
"index", rRedlineTable[
i]->
GetId());
3266 rJson.
put(
"author", rRedlineTable[
i]->GetAuthorString(1));
3268 rRedlineTable[
i]->GetRedlineData().GetType()));
3269 rJson.
put(
"comment",
3270 rRedlineTable[
i]->GetRedlineData().GetComment());
3271 rJson.
put(
"description", rRedlineTable[
i]->GetDescr());
3273 rRedlineTable[
i]->GetRedlineData().GetTimeStamp().GetUNODateTime());
3274 rJson.
put(
"dateTime", sDateTime);
3276 SwContentNode* pContentNd = rRedlineTable[
i]->GetPointContentNode();
3278 if (pView && pContentNd)
3282 aCursor.
GetMark()->
Assign(*pContentNd, rRedlineTable[
i]->
End()->GetContentIndex());
3287 std::vector<OString> aRects;
3288 for (
const SwRect& rNextRect : *pRects)
3289 aRects.push_back(rNextRect.SVRect().toString());
3292 rJson.
put(
"textRange", sRects);
3299 SW_MOD()->GetRedlineAuthorInfo(rJsonWriter);
3311 auto commentsNode = rJsonWriter.
startArray(
"comments");
3325 aRect.
Pos().getX() + aRect.
SSize().Width(),
3326 aRect.
Pos().getY() + aRect.
SSize().Height());
3328 if (!sidebarItem->maLayoutInfo.mPositionFromCommentAnchor)
3334 std::vector<OString> aRects;
3337 const SwRect rect(aRange.getMinX(), aRange.getMinY(), aRange.getWidth(), aRange.getHeight());
3346 rJsonWriter.
put(
"author", pField->
GetPar1());
3348 rJsonWriter.
put(
"resolved", pField->
GetResolved() ?
"true" :
"false");
3351 rJsonWriter.
put(
"textRange", sRects);
3358 if (aIter ==
aArguments.end() || aIter->second !=
"drop-down")
3362 if (aIter ==
aArguments.end() || aIter->second !=
"selected")
3369 sal_Int32 nSelection = aIter->second.toInt32();
3379 if (nSelection >= 0)
3382 pFieldBM->Invalidate();
3389std::vector<basegfx::B2DRange>
3394 return std::vector<basegfx::B2DRange>();
3402 return std::vector<basegfx::B2DRange>();
3407 OStringBuffer aState;
3421 aState.append(aThemeName);
3424 return aState.makeStringAndClear();
3429inline constexpr OUStringLiteral SELECTED_DATE_FORMAT =
u"YYYY-MM-DD";
3434 auto it = rArguments.find(
"type");
3435 if (it == rArguments.end())
3440 if (it->second ==
"drop-down")
3457 auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
3459 std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.
GetContentControl();
3460 if (!pContentControl->GetComboBox() && !pContentControl->GetDropDown())
3465 it = rArguments.find(
"selected");
3466 if (it == rArguments.end())
3471 sal_Int32 nSelection = it->second.toInt32();
3472 pContentControl->SetSelectedListItem(nSelection);
3475 else if (it->second ==
"picture")
3477 it = rArguments.find(
"changed");
3478 if (it == rArguments.end())
3492 SfxCallMode::SYNCHRON, { &aItem });
3494 else if (it->second ==
"date")
3511 auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
3514 std::shared_ptr<SwContentControl> pContentControl
3516 if (!pContentControl->GetDate())
3521 it = rArguments.find(
"selected");
3522 if (it == rArguments.end())
3527 OUString aSelectedDate = it->second.replaceAll(
"T00:00:00Z",
"");
3534 sal_Int32 nCheckPos = 0;
3536 OUString sFormat = SELECTED_DATE_FORMAT;
3545 double dCurrentDate = 0;
3546 pNumberFormatter->
IsNumberFormat(aSelectedDate, nFormat, dCurrentDate);
3547 pContentControl->SetSelectedDate(dCurrentDate);
3565 return SwResId(STR_PAGE) + OUString::number(nPart + 1);
3570 OUString sPart(
SwResId(STR_PAGE) + OUString::number(nPart + 1));
3572 return OUString::number(sPart.hashCode());
3611 OUString sOrigAuthor =
SW_MOD()->GetRedlineAuthor(
SW_MOD()->GetRedlineAuthor());
3614 for (
const beans::PropertyValue& rValue : rArguments)
3616 if (rValue.Name ==
".uno:HideWhitespace" && rValue.Value.has<
bool>())
3618 else if (rValue.Name ==
".uno:ShowBorderShadow" && rValue.Value.has<
bool>())
3620 else if (rValue.Name ==
".uno:Author" && rValue.Value.has<OUString>())
3622 sAuthor = rValue.Value.get<OUString>();
3630 else if (rValue.Name ==
".uno:SpellOnline" && rValue.Value.has<
bool>())
3634 if (!sAuthor.isEmpty() && sAuthor != sOrigAuthor)
3641 pShell->SwViewShell::UpdateFields(
true);
3642 pShell->ResetModified();
3670 officecfg::Office::Common::Save::Document::WarnAlienFormat::set(
false, xChanges);
3710 Point aPointTwip(nX, nY);
3716 MouseEventModifiers::SIMPLECLICK,
3717 nButtons, nModifier);
3733 case LOK_SETTEXTSELECTION_START:
3736 case LOK_SETTEXTSELECTION_END:
3739 case LOK_SETTEXTSELECTION_RESET:
3752 uno::Reference<datatransfer::XTransferable> xTransferable;
3757 if (pSdrView->GetTextEditObject())
3760 EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView();
3770 EditView& rEditView = pWin->GetOutlinerView()->GetEditView();
3775 if (!xTransferable.is() && pWrtShell)
3778 return xTransferable;
3797 case LOK_SETGRAPHICSELECTION_START:
3800 case LOK_SETGRAPHICSELECTION_END:
3817void 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 )
3822 sal_Int64 nWindowHandle;
3823 Parent >>= nWindowHandle;
3824 aData.hWnd =
reinterpret_cast<HWND
>(nWindowHandle);
3826 paintTile(*xDevice, nOutputWidth, nOutputHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3831 (void)nOutputHeight;
3843 ::sal_Int16 nScriptTypes,
3844 ::sal_Int16 nMaxCount )
3850 const sal_Int16 nLatin = 0x001;
3851 const sal_Int16 nAsian = 0x002;
3852 const sal_Int16 nComplex = 0x004;
3855 const bool bLatin = 0 != (nScriptTypes & nLatin);
3856 const bool bAsian = 0 != (nScriptTypes & nAsian);
3857 const bool bComplex = 0 != (nScriptTypes & nComplex);
3859 if (nScriptTypes < nLatin || nScriptTypes > (nLatin | nAsian | nComplex))
3860 throw IllegalArgumentException(
"nScriptTypes ranges from 1 to 7!", Reference< XInterface >(), 1);
3862 throw DisposedException();
3866 std::set< LanguageType > aAllLangs;
3871 for(
size_t i = 0;
i < pFormats->
size(); ++
i)
3873 const SwAttrSet &rAttrSet = (*pFormats)[
i]->GetAttrSet();
3879 aAllLangs.insert(
nLang );
3885 aAllLangs.insert(
nLang );
3891 aAllLangs.insert(
nLang );
3896 for (
size_t i = 0;
i < pColls->
size(); ++
i)
3898 const SwAttrSet &rAttrSet = (*pColls)[
i]->GetAttrSet();
3904 aAllLangs.insert(
nLang );
3910 aAllLangs.insert(
nLang );
3916 aAllLangs.insert(
nLang );
3928 std::vector< std::shared_ptr<SfxItemSet> > rStyles;
3930 while (!rStyles.empty())
3932 std::shared_ptr<SfxItemSet> pStyle = rStyles.back();
3942 aAllLangs.insert(
nLang );
3949 aAllLangs.insert(
nLang );
3956 aAllLangs.insert(
nLang );
3971 sal_Int32 nParCount = pOutliner->GetParagraphCount();
3972 for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
3975 std::vector<sal_Int32> aPortions;
3978 for (
size_t nPos = aPortions.size();
nPos; )
3982 sal_Int32 nEnd = aPortions[
nPos ];
3983 sal_Int32 nStart =
nPos ? aPortions[
nPos - 1 ] : 0;
3984 ESelection aSelection( nPar, nStart, nPar, nEnd );
3992 aAllLangs.insert(
nLang );
3998 aAllLangs.insert(
nLang );
4004 aAllLangs.insert(
nLang );
4011 if (nMaxCount >
static_cast< sal_Int16
>( aAllLangs.size() ))
4012 nMaxCount =
static_cast< sal_Int16
>( aAllLangs.size() );
4015 uno::Sequence< lang::Locale > aLanguages( nMaxCount );
4016 lang::Locale* pLanguage = aLanguages.getArray();
4020 for (
const auto& rLang : aAllLangs)
4065 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4072 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4079 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4086 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4093 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4100 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4107 aRet <<= Reference< XPropertySet >(xBkms, UNO_QUERY);
4114 aRet <<= Reference<XPropertySet>(xDrawingObjects, UNO_QUERY);
4117 throw NoSuchElementException();
4160 return "SwXLinkTargetSupplier";
4170 Sequence< OUString > aRet {
"com.sun.star.document.LinkTargets" };
4175 Reference< XNameAccess >
const & xAccess, OUString aLinkDisplayName, OUString sSuffix ) :
4176 m_xRealAccess(xAccess),
4179 m_sLinkDisplayName(
std::move(aLinkDisplayName)),
4185 OUString aLinkDisplayName, OUString sSuffix) :
4188 m_sLinkDisplayName(
std::move(aLinkDisplayName)),
4200 bool bFound =
false;
4202 OUString sParam = rName;
4204 if(sParam.getLength() >
sSuffix.getLength() )
4206 std::u16string_view sCmp = sParam.subView(sParam.getLength() -
sSuffix.getLength(),
4212 sParam = sParam.copy(0, sParam.getLength() -
sSuffix.getLength());
4221 for (
size_t i = 0;
i < nOutlineCount && !bFound; ++
i)
4225 OUString sOutlineText =
4229 Reference<XPropertySet> xOutline =
4236 else if (
sSuffix ==
"|drawingobject")
4245 if (sParam == pObj->
GetName())
4248 aRet <<= xDrawingObject;
4258 Reference< XInterface > xInt;
4259 if(!(aRet >>= xInt))
4261 Reference< XPropertySet > xProp(xInt, UNO_QUERY);
4268 throw NoSuchElementException();
4274 Sequence< OUString > aRet;
4283 const size_t nOutlineCount = rOutlineNodes.
size();
4284 aRet.realloc(nOutlineCount);
4285 OUString* pResArr = aRet.getArray();
4286 for (
size_t i = 0;
i < nOutlineCount; ++
i)
4289 pResArr[
i] = sEntry;
4299 aRet.realloc(nObjCount);
4300 OUString* pResArr = aRet.getArray();
4302 for (
size_t i = 0;
i < nObjCount; ++
i)
4305 if (!pObj->
GetName().isEmpty())
4306 pResArr[j++] = pObj->
GetName() +
"|drawingobject";
4313 const Sequence< OUString > aOrg =
m_xRealAccess->getElementNames();
4314 aRet.realloc(aOrg.getLength());
4315 std::transform(aOrg.begin(), aOrg.end(), aRet.getArray(),
4316 [
this](
const OUString& rOrg) -> OUString { return rOrg + m_sLinkSuffix; });
4324 OUString sParam(rName);
4327 std::u16string_view sCmp = sParam.subView(sParam.getLength() -
m_sLinkSuffix.getLength(),
4331 sParam = sParam.copy(0, sParam.getLength() -
m_sLinkSuffix.getLength());
4341 for (
size_t i = 0;
i < nOutlineCount && !bRet; ++
i)
4356 for (
size_t i = 0;
i < nObjCount && !bRet; ++
i)
4383 OSL_FAIL(
"not implemented");
4399 const OUString& rPropName,
const Any& )
4401 throw UnknownPropertyException(rPropName);
4407 if(!sLinkSuffix.empty())
4408 sLinkSuffix = sLinkSuffix.substr(1);
4411 if(sLinkSuffix ==
u"outline")
4412 sImgId = RID_BMP_NAVI_OUTLINE;
4413 else if(sLinkSuffix ==
u"table")
4414 sImgId = RID_BMP_NAVI_TABLE;
4415 else if(sLinkSuffix ==
u"frame")
4416 sImgId = RID_BMP_NAVI_FRAME;
4417 else if(sLinkSuffix ==
u"graphic")
4418 sImgId = RID_BMP_NAVI_GRAPHIC;
4419 else if(sLinkSuffix ==
u"ole")
4420 sImgId = RID_BMP_NAVI_OLE;
4421 else if(sLinkSuffix.empty())
4422 sImgId = RID_BMP_NAVI_BOOKMARK;
4423 else if(sLinkSuffix ==
u"region")
4424 sImgId = RID_BMP_NAVI_REGION;
4425 else if(sLinkSuffix ==
u"drawingobject")
4426 sImgId = RID_BMP_NAVI_DRAWOBJECT;
4428 if (!sImgId.isEmpty())
4447 throw UnknownPropertyException(rPropertyName);
4452 const OUString& ,
const Reference< XPropertyChangeListener > & )
4456 const OUString& ,
const Reference< XPropertyChangeListener > & )
4460 const OUString& ,
const Reference< XVetoableChangeListener > & )
4464 const OUString& ,
const Reference< XVetoableChangeListener > & )
4474 return "SwXLinkNameAccessWrapper";
4484 Sequence< OUString > aRet {
"com.sun.star.document.LinkTargets" };
4489 const sal_Int32 nOutlineLevel) :
4491 m_sOutlineText(
std::move(aOutlineText)),
4492 m_sActualText(
std::move(aActualText)),
4493 m_nOutlineLevel(nOutlineLevel)
4508 const OUString& rPropertyName,
const Any& )
4510 throw UnknownPropertyException(rPropertyName);
4516 rPropertyName !=
"OutlineLevel")
4517 throw UnknownPropertyException(rPropertyName);
4519 if (rPropertyName ==
"ActualOutlineName")
4522 if (rPropertyName ==
"OutlineLevel")
4529 const OUString& ,
const Reference< XPropertyChangeListener > & )
4534 const OUString& ,
const Reference< XPropertyChangeListener > & )
4539 const OUString& ,
const Reference< XVetoableChangeListener > & )
4544 const OUString& ,
const Reference< XVetoableChangeListener > & )
4550 return "SwXOutlineTarget";
4560 Sequence<OUString> aRet {
"com.sun.star.document.LinkTarget" };
4567 m_sDrawingObjectText(
std::move(aDrawingObjectText))
4582 const OUString& rPropertyName,
const Any& )
4584 throw UnknownPropertyException(rPropertyName);
4590 throw UnknownPropertyException(rPropertyName);
4596 const OUString& ,
const Reference< XPropertyChangeListener > & )
4601 const OUString& ,
const Reference< XPropertyChangeListener > & )
4606 const OUString& ,
const Reference< XVetoableChangeListener > & )
4611 const OUString& ,
const Reference< XVetoableChangeListener > & )
4617 return "SwXDrawingObjectTarget";
4627 Sequence<OUString> aRet {
"com.sun.star.document.LinkTarget" };
4644 Reference<XInterface> xRet;
4686#if OSL_DEBUG_LEVEL > 0
4687 default: OSL_FAIL(
"which table?");
4716 , m_aOldViewOptions( rViewOptions )
4735 const bool bContainsHiddenFields = pFieldType && pFieldType->HasWriterListeners();
4737 const bool bContainsHiddenParagraphs = pFieldType && pFieldType->HasWriterListeners();
4739 const bool bContainsPlaceHolders = pFieldType && pFieldType->HasWriterListeners();
4749 aRenderViewOptions.
SetBlank(
false );
4751 aRenderViewOptions.
SetTab(
false );
4757 if (bContainsHiddenChars)
4759 if (bContainsHiddenFields)
4761 if (bContainsHiddenParagraphs)
4764 if (bContainsPlaceHolders)
4771 if (bContainsFields)
4780 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
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
css::uno::Reference< css::script::XLibraryContainer > GetBasicContainer()
bool IsEnableSetModified() const
css::uno::Reference< css::script::XLibraryContainer > GetDialogContainer()
SfxMedium * GetMedium() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
void EnableSetModified(bool bEnable=true)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
void AppendItem(const SfxPoolItem &)
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SfxViewShell * GetViewShell() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxDispatcher * GetDispatcher()