21#include <officecfg/Office/Common.hxx>
37#include <LibreOfficeKit/LibreOfficeKitEnums.h>
67#include <unoprnms.hxx>
81#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
82#include <com/sun/star/lang/DisposedException.hpp>
83#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
84#include <com/sun/star/lang/NoSupportException.hpp>
85#include <com/sun/star/beans/PropertyAttribute.hpp>
86#include <com/sun/star/beans/XFastPropertySet.hpp>
87#include <com/sun/star/beans/XPropertyAccess.hpp>
88#include <com/sun/star/document/RedlineDisplayType.hpp>
89#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
90#include <com/sun/star/frame/XController.hpp>
91#include <com/sun/star/frame/XFrame.hpp>
92#include <com/sun/star/script/XInvocation.hpp>
93#include <com/sun/star/view/XSelectionSupplier.hpp>
100#include <strings.hrc>
101#include <bitmaps.hlst>
115#include <drawdoc.hxx>
117#include <osl/file.hxx>
152#include <editeng/editeng.hxx>
182using ::osl::FileBase;
191 const bool bWebDoc =
nullptr !=
dynamic_cast< const SwWebDocShell *
>(pDocShell);
192 const bool bSwSrcView =
nullptr !=
dynamic_cast< const SwSrcView *
>(pView);
193 const SwView * pSwView =
dynamic_cast< const SwView *
>(pView);
194 const bool bHasSelection = pSwView && pSwView->
HasSelection(
false );
201 sal_uInt16 nCurrentPage = 1;
210 else if (!bSwSrcView)
213 OSL_ENSURE(pPreview,
"Unexpected type of the view shell");
224 sal_uInt16 nMax = nCurrentPage;
226 while (pPage && nMax-- > 0)
233 return std::make_unique<SwPrintUIOptions>( nCurrentPage, bWebDoc, bSwSrcView, bHasSelection, bHasPostIts, rPrintData );
243 if( USHRT_MAX !=
nId )
255 if( pFound == pToClose)
274 return theSwXTextDocumentUnoTunnelId.
getSeq();
279 if( comphelper::isUnoTunnelId<SwXTextDocument>(rId) )
283 if( comphelper::isUnoTunnelId<SfxObjectShell>(rId) )
296 Reference<XUnoTunnel> xNumTunnel;
297 aNumTunnel >>= xNumTunnel;
298 return (xNumTunnel.is()) ? xNumTunnel->getSomething(rId) : 0;
303 Any aRet = SwXTextDocumentBaseClass::queryInterface(rType);
304 if ( !aRet.hasValue() )
306 if ( !aRet.hasValue() &&
309 Reference<lang::XMultiServiceFactory> xTmp =
this;
312 if ( !aRet.hasValue() &&
315 Reference<tiledrendering::XTiledRenderable> xTmp =
this;
319 if ( !aRet.hasValue()
346 Sequence< uno::Type > aNumTypes;
352 Reference<XTypeProvider> xNumProv;
353 if(aNumProv >>= xNumProv)
355 aNumTypes = xNumProv->getTypes();
360 SwXTextDocumentBaseClass::getTypes(),
373 m_bObjectValid(pShell != nullptr),
374 m_pHiddenViewFrame(nullptr),
376 m_bApplyPagePrintSettingsFromXPagePrintable( false )
391 Reference< XInterface > x0;
435 Reference< XUnoTunnel > xNumTunnel;
436 aNumTunnel >>= xNumTunnel;
438 = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xNumTunnel);
439 OSL_ENSURE(pNumFormat,
"No number formatter available");
454 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
466 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
473 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
506 Reference< XInterface > xRef;
561 uno::Sequence< uno::Any > aArgs;
584 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
597 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
609 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
621 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
629Reference< XPropertySet > SAL_CALL
634 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
646 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
658 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
670 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
689 xCursor.set(
static_cast<text::XWordCursor*
>(pXTextCursor.get()) );
691 auto& rUnoCursor(pXTextCursor->GetCursor());
692 rUnoCursor.SetRemainInSection(
false);
701 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
703 Reference< XTextCursor > xCursor;
714 pUnoCursor->SetRemainInSection(
false);
729 nResult = pUnoCursor->FindAttrs(aSearch, !pSearch->
m_bStyles,
730 eStart, eEnd, bCancel,
741 nResult = pUnoCursor->FindFormat(*pSearchColl,
742 eStart, eEnd, bCancel,
743 static_cast<FindRanges>(eRanges), pReplaceColl );
750 nResult = pUnoCursor->Find_Text(aSearchOpt,
false,
751 eStart, eEnd, bCancel,
767 Reference< XTextCursor > & xCursor,
770 Reference< XInterface >
const & xLastResult)
772 const auto pSearch =
dynamic_cast<SwXTextSearch*
>(xDesc.get());
778 bool bParentInExtra =
false;
781 OTextCursorHelper* pPosCursor =
dynamic_cast<OTextCursorHelper*
>(xLastResult.get());
782 SwPaM* pCursor = pPosCursor ? pPosCursor->GetPaM() :
nullptr;
786 pUnoCursor->DeleteMark();
794 if(pUnoCursor->HasMark())
796 if(*pUnoCursor->GetPoint() < *pUnoCursor->GetMark())
797 pUnoCursor->Exchange();
798 pUnoCursor->DeleteMark();
801 const SwNode& rRangeNode = pUnoCursor->GetPointNode();
809 pSearch->FillSearchOptions( aSearchOpt );
828 for (
int nSearchProc = 0; nSearchProc < 2; ++nSearchProc)
831 if(pSearch->HasSearchAttributes())
839 pSearch->FillSearchItemSet(aSearch);
841 nResult = pUnoCursor->FindAttrs(aSearch, !pSearch->m_bStyles,
842 eStart, eEnd, bCancel,
844 !pSearch->m_sSearchText.isEmpty() ? &aSearchOpt :
nullptr );
846 else if(pSearch->m_bStyles)
852 nResult = pUnoCursor->FindFormat(*pSearchColl,
853 eStart, eEnd, bCancel,
854 eRanges, pReplaceColl );
860 nResult = pUnoCursor->Find_Text(aSearchOpt,
false,
861 eStart, eEnd, bCancel,
872Reference< XIndexAccess >
876 Reference< XInterface > xTmp;
877 sal_Int32 nResult = 0;
878 Reference< XTextCursor > xCursor;
879 auto pResultCursor(
FindAny(xDesc, xCursor,
true, nResult, xTmp));
889 Reference< XInterface > xTmp;
890 sal_Int32 nResult = 0;
891 Reference< XTextCursor > xCursor;
892 auto pResultCursor(
FindAny(xDesc, xCursor,
false, nResult, xTmp));
895 Reference< XInterface > xRet;
898 const uno::Reference< text::XText > xParent =
900 *pResultCursor->GetPoint());
907 const Reference< util::XSearchDescriptor > & xDesc)
910 sal_Int32 nResult = 0;
911 Reference< XTextCursor > xCursor;
914 auto pResultCursor(
FindAny(xDesc, xCursor,
false, nResult, xStartAt));
917 Reference< XInterface > xRet;
920 const uno::Reference< text::XText > xParent =
922 *pResultCursor->GetPoint());
932 Sequence< beans::PropertyValue >
aSeq(9);
934 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
936 beans::PropertyValue* pArray =
aSeq.getArray();
942 aVal <<= static_cast<sal_Int16>(
aData.GetRow());
943 pArray[0] = beans::PropertyValue(
"PageRows", -1, aVal, PropertyState_DIRECT_VALUE);
944 aVal <<= static_cast<sal_Int16>(
aData.GetCol());
945 pArray[1] = beans::PropertyValue(
"PageColumns", -1, aVal, PropertyState_DIRECT_VALUE);
947 pArray[2] = beans::PropertyValue(
"LeftMargin", -1, aVal, PropertyState_DIRECT_VALUE);
949 pArray[3] = beans::PropertyValue(
"RightMargin", -1, aVal, PropertyState_DIRECT_VALUE);
951 pArray[4] = beans::PropertyValue(
"TopMargin", -1, aVal, PropertyState_DIRECT_VALUE);
953 pArray[5] = beans::PropertyValue(
"BottomMargin", -1, aVal, PropertyState_DIRECT_VALUE);
955 pArray[6] = beans::PropertyValue(
"HoriMargin", -1, aVal, PropertyState_DIRECT_VALUE);
957 pArray[7] = beans::PropertyValue(
"VertMargin", -1, aVal, PropertyState_DIRECT_VALUE);
958 aVal <<=
aData.GetLandscape();
959 pArray[8] = beans::PropertyValue(
"IsLandscape", -1, aVal, PropertyState_DIRECT_VALUE);
967 TypeClass
eType = rValue.getValueType().getTypeClass();
970 if(
eType == TypeClass_UNSIGNED_LONG )
975 bException = !(rValue >>= nVal);
977 nRet =
static_cast<sal_uInt32
>(nVal);
985 OUStringBuffer sEntry;
998 sEntry.append( nVal );
1003 sEntry.append(sOutlineText);
1004 return sEntry.makeStringAndClear();
1011 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1018 for(
const beans::PropertyValue& rProperty : aSettings)
1020 OUString
sName = rProperty.Name;
1021 const Any& rVal = rProperty.Value;
1024 if(
sName ==
"PageRows" )
1026 if(!nVal || nVal > 0xff)
1030 else if(
sName ==
"PageColumns")
1032 if(!nVal || nVal > 0xff)
1036 else if(
sName ==
"LeftMargin")
1040 else if(
sName ==
"RightMargin")
1044 else if(
sName ==
"TopMargin")
1048 else if(
sName ==
"BottomMargin")
1052 else if(
sName ==
"HoriMargin")
1056 else if(
sName ==
"VertMargin")
1060 else if(
sName ==
"IsLandscape")
1066 aData.SetLandscape(*b);
1082 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1089 for (
const beans::PropertyValue &rProp : xOptions )
1092 Any aValue( rProp.Value );
1098 if ( rProp.Value >>= sFileURL )
1101 OUString sSystemPath;
1102 FileBase::getSystemPathFromFileURL ( sFileURL, sSystemPath );
1106 throw IllegalArgumentException();
1112 sal_Int32 nCopies = 0;
1122 throw IllegalArgumentException();
1132 throw IllegalArgumentException();
1141 if ( !(rProp.Value >>= sTmp) )
1142 throw IllegalArgumentException();
1161 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1173 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1185 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1197 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1209 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1221 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1233 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1245 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1257 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1269 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1281 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1294 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1308class SwDrawPagesObj :
public cppu::WeakImplHelper<
1309 css::drawing::XDrawPages,
1310 css::lang::XServiceInfo>
1313 css::uno::Reference< css::drawing::XDrawPageSupplier > m_xDoc;
1315 SwDrawPagesObj(css::uno::Reference< css::drawing::XDrawPageSupplier > xDoc) : m_xDoc(
std::move(xDoc)) {}
1318 virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
1319 insertNewByIndex(sal_Int32 )
override {
throw css::lang::NoSupportException(); }
1321 virtual void SAL_CALL
remove(
const css::uno::Reference< css::drawing::XDrawPage >& )
override
1323 throw css::lang::NoSupportException();
1327 virtual sal_Int32 SAL_CALL getCount()
override {
return 1; }
1329 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32
Index)
override
1332 throw css::lang::IndexOutOfBoundsException(
"Writer documents have only one DrawPage!");
1333 return css::uno::Any(m_xDoc->getDrawPage());
1337 virtual css::uno::Type SAL_CALL getElementType()
override
1342 virtual sal_Bool SAL_CALL hasElements()
override {
return true; }
1347 return "SwDrawPagesObj";
1357 return {
"com.sun.star.drawing.DrawPages" };
1368 return new SwDrawPagesObj(
this);
1378 Reference< XUnoTunnel > xNumTunnel;
1379 aNumTunnel >>= xNumTunnel;
1381 = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xNumTunnel);
1382 OSL_ENSURE(pNumFormat,
"No number formatter available");
1385 OSL_ENSURE(pNumFormat,
"No number formatter available");
1390 std::unique_lock aGuard(
m_pImpl->m_Mutex);
1391 m_pImpl->m_RefreshListeners.disposeAndClear(aGuard, ev);
1439 Reference< XUnoTunnel > xNumTunnel;
1440 aNumTunnel >>= xNumTunnel;
1442 = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xNumTunnel);
1443 OSL_ENSURE(pNumFormat,
"No number formatter available");
1586 OUString
const & rServiceName,
1587 css::uno::Sequence<css::uno::Any>
const * arguments)
1591 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1598 if (rServiceName ==
"com.sun.star.drawing.DashTable")
1602 if (rServiceName ==
"com.sun.star.drawing.GradientTable")
1606 if (rServiceName ==
"com.sun.star.drawing.HatchTable")
1610 if (rServiceName ==
"com.sun.star.drawing.BitmapTable")
1614 if (rServiceName ==
"com.sun.star.drawing.TransparencyGradientTable")
1618 if (rServiceName ==
"com.sun.star.drawing.MarkerTable")
1622 if (rServiceName ==
"com.sun.star.drawing.Defaults")
1626 if (rServiceName ==
"com.sun.star.document.Settings")
1630 if (rServiceName ==
"com.sun.star.document.ImportEmbeddedObjectResolver")
1634 *
m_pDocShell, SvXMLEmbeddedObjectHelperMode::Read));
1636 if (rServiceName ==
"com.sun.star.text.DocumentSettings")
1640 if (rServiceName ==
"com.sun.star.chart2.data.DataProvider")
1642 return Reference<XInterface>(
1643 static_cast<chart2::data::XDataProvider *
>(
1645 GetChartDataProvider()));
1647 if (!rServiceName.startsWith(
"com.sun.star.")
1648 || rServiceName.endsWith(
".OLE2Shape"))
1655 throw ServiceNotRegisteredException();
1660 OUString aTmpServiceName(rServiceName);
1661 if (rServiceName ==
"com.sun.star.drawing.temporaryForXMLImportOLE2Shape")
1663 aTmpServiceName =
"com.sun.star.drawing.OLE2Shape";
1665 Reference<XInterface> xTmp(
1666 arguments ==
nullptr
1669 aTmpServiceName, *arguments));
1670 if (rServiceName ==
"com.sun.star.drawing.GroupShape"
1671 || rServiceName ==
"com.sun.star.drawing.Shape3DSceneObject")
1675 if (rServiceName.startsWith(
"com.sun.star.drawing."))
1684 return create(rServiceName,
nullptr);
1688 const OUString& ServiceSpecifier,
1689 const Sequence< Any >& Arguments)
1691 return create(ServiceSpecifier, &Arguments);
1696 static Sequence< OUString > aServices;
1697 if ( !aServices.hasElements() )
1703 auto nLength = aRet.getLength();
1704 aRet.getArray()[
i] = aRet[
nLength - 1];
1716 return "SwXTextDocument";
1735 bool bTextDoc = (!bWebDoc && !bGlobalDoc);
1737 Sequence< OUString > aRet (3);
1738 OUString* pArray = aRet.getArray();
1740 pArray[0] =
"com.sun.star.document.OfficeDocument";
1741 pArray[1] =
"com.sun.star.text.GenericTextDocument";
1744 pArray[2] =
"com.sun.star.text.TextDocument";
1746 pArray[2] =
"com.sun.star.text.WebDocument";
1747 else if (bGlobalDoc)
1748 pArray[2] =
"com.sun.star.text.GlobalDocument";
1757 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1776 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1781 throw UnknownPropertyException(rPropertyName);
1782 if(pEntry->
nFlags & PropertyAttribute::READONLY)
1783 throw PropertyVetoException();
1784 switch(pEntry->
nWID)
1797 SW_MOD()->GetModuleConfig()->SetWordDelimiter(sDelim);
1803 bool bSet = *o3tl::doAccess<bool>(aValue);
1820 Sequence <sal_Int8> aNew;
1825 if(aNew.hasElements())
1842 SW_MOD()->GetModuleConfig()->SetHideFieldTips(*o3tl::doAccess<bool>(aValue));
1855 case RedlineDisplayType::
1858 default:
throw IllegalArgumentException();
1865 sal_Int16 nYear = 0;
1875 bool bAuto = *o3tl::doAccess<bool>(aValue);
1877 if (
nullptr != pDrawDoc )
1895 bool bMode = *o3tl::doAccess<bool>(aValue);
1897 if (
nullptr != pDrawDoc )
1919 if( aValue >>= bBool )
1929 if (aValue >>= bBool)
1946 bool bDefaultPageMode(
false );
1947 aValue >>= bDefaultPageMode;
1952 setGrabBagItem(aValue);
1958 std::unique_ptr<SfxPoolItem> pNewItem(rItem.
Clone());
1959 pNewItem->PutValue(aValue, pEntry->
nMemberId);
1969 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
1974 throw UnknownPropertyException(rPropertyName);
1976 switch(pEntry->
nWID)
1987 switch(pEntry->
nWID)
1998 aAny <<=
SW_MOD()->GetDocStatWordDelim();
2027 aAny <<=
SW_MOD()->GetModuleConfig()->IsHideFieldTips();
2037 nRet = RedlineDisplayType::REMOVED;
2039 nRet = RedlineDisplayType::INSERTED_AND_REMOVED;
2059 if (
nullptr != pDrawDoc )
2070 if (
nullptr != pDrawDoc )
2090 aAny <<= OUString(
"ThisWordDoc" );
2094 aAny <<= getRuntimeUID();
2103 aAny <<= hasValidSignatures();
2106 getGrabBagItem(aAny);
2119 const Reference< XPropertyChangeListener > & )
2121 OSL_FAIL(
"not implemented");
2125 const Reference< XPropertyChangeListener > & )
2127 OSL_FAIL(
"not implemented");
2131 const Reference< XVetoableChangeListener > & )
2133 OSL_FAIL(
"not implemented");
2137 const Reference< XVetoableChangeListener > & )
2139 OSL_FAIL(
"not implemented");
2165 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2166 m_pImpl->m_RefreshListeners.notifyEach(aGuard,
2167 & util::XRefreshListener::refreshed, ev);
2174 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2183 const Reference<util::XRefreshListener> & xListener)
2187 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2188 m_pImpl->m_RefreshListeners.addInterface(aGuard, xListener);
2193 const Reference<util::XRefreshListener> & xListener)
2197 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2198 m_pImpl->m_RefreshListeners.removeInterface(aGuard, xListener);
2206 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2222 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2226 throw UnknownPropertyException(rPropertyName);
2227 return PropertyState_DIRECT_VALUE;
2232 const sal_Int32
nCount = rPropertyNames.getLength();
2233 Sequence < PropertyState > aRet (
nCount );
2235 std::transform(rPropertyNames.begin(), rPropertyNames.end(), aRet.getArray(),
2236 [
this](
const OUString& rName) -> PropertyState { return getPropertyState(rName); });
2245 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2249 throw UnknownPropertyException(rPropertyName);
2250 switch(pEntry->
nWID)
2252 case 0:
default:
break;
2260 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2264 throw UnknownPropertyException(rPropertyName);
2266 switch(pEntry->
nWID)
2268 case 0:
default:
break;
2278 uno::Reference< awt::XDevice > xRenderDevice;
2279 aAny >>= xRenderDevice;
2280 if (xRenderDevice.is())
2290 const uno::Sequence< beans::PropertyValue >& rOptions,
2291 const char *pPropName )
2293 return std::any_of(rOptions.begin(), rOptions.end(),
2294 [&pPropName](
const beans::PropertyValue& rProp) {
2295 return rProp.Name.equalsAscii( pPropName ); });
2299 const uno::Sequence< beans::PropertyValue >& rOptions,
2300 const char *pPropName )
2303 auto pOption = std::find_if(rOptions.begin(), rOptions.end(),
2304 [&pPropName](
const beans::PropertyValue& rProp) {
2305 return rProp.Name.equalsAscii( pPropName ); });
2306 if (pOption != rOptions.end())
2307 pOption->Value >>= bRes;
2312 bool &rbIsSwSrcView,
2313 const uno::Sequence< beans::PropertyValue >& rOptions,
2323 auto pOption = std::find_if(rOptions.begin(), rOptions.end(),
2324 [](
const beans::PropertyValue& rProp) { return rProp.Name ==
"View"; });
2325 if (pOption != rOptions.end())
2326 aTmp = pOption->
Value;
2331 OSL_ENSURE(
xController.is(),
"controller is empty!" );
2351 SwDoc *pDoc =
nullptr;
2353 uno::Reference< frame::XModel >
xModel;
2359 OSL_ENSURE( !
xModel.is(),
"unexpected model found" );
2368 bool bIsSwSrcView =
false;
2370 OSL_ENSURE( bIsPDFExport,
"view is missing, guessing one..." );
2374 OSL_ENSURE( rpView,
"SwViewShell missing" );
2378 if (
auto pSwView =
dynamic_cast<SwView *
>( rpView ))
2382 OSL_FAIL(
"GetRenderDoc: no renderdata");
2388 xDocSh = pSwView->CreateTmpSelectionDoc();
2393 pDoc =
static_cast<SwDocShell*
>(&xDocSh)->GetDoc();
2399 OSL_FAIL(
"unexpected SwViewShell" );
2437 const uno::Sequence< beans::PropertyValue >& rxOptions )
2442 throw DisposedException( OUString(),
2443 static_cast< XTextDocument*
>(
this) );
2447 bool bIsSwSrcView =
false;
2457 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2458 if (!pDoc || !pView)
2469 nRet = rSwSrcView.
PrintSource( pOutDev, 1 ,
true );
2484 if ( bIsPDFExport && bFormat )
2492 pViewShell =
static_cast<SwPagePreview*
>(pView)->GetViewShell();
2495 if (!pViewShell || !pViewShell->
GetLayout())
2538 bool setShowPlaceHoldersInPDF =
false;
2541 m_pRenderData->ViewOptionAdjust( pPrtOptions, setShowPlaceHoldersInPDF );
2554 bool bStateChanged =
false;
2559 bStateChanged =
true;
2561 pViewShell->SwViewShell::UpdateFields(
true);
2573 const sal_Int32 nPageCount = pViewShell->
GetPageCount();
2581 nRet =
m_pRenderData->GetPagePairsForProspectPrinting().size();
2605 OSL_ENSURE( nRet >= 0,
"negative number of pages???" );
2615 sal_Int32 nRenderer,
2617 const uno::Sequence< beans::PropertyValue >& rxOptions )
2622 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
2626 bool bIsSwSrcView =
false;
2640 const bool bIsSkipEmptyPages = !
m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport );
2641 const bool bPrintPaperFromSetup =
m_pPrintUIOptions->getBoolValue(
"PrintPaperFromSetup" );
2644 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2645 if (!pDoc || !pView)
2646 return uno::Sequence< beans::PropertyValue >();
2652 throw IllegalArgumentException();
2662 sal_Int32 nMaxRenderer = 0;
2666 nMaxRenderer = bPrintProspect?
2667 m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
2672 if (!bIsSwSrcView &&
m_pRenderData && nRenderer > nMaxRenderer)
2673 return uno::Sequence< beans::PropertyValue >();
2675 uno::Sequence< beans::PropertyValue > aRenderer;
2682 const sal_Int32 nPage = bPrintProspect
2687 sal_Int32 nPrinterPaperTray = -1;
2688 if (! bPrintPaperFromSetup)
2691 const std::map< sal_Int32, sal_Int32 > &rPaperTrays =
m_pRenderData->GetPrinterPaperTrays();
2692 std::map< sal_Int32, sal_Int32 >::const_iterator aIt( rPaperTrays.find( nPage ) );
2693 if (aIt != rPaperTrays.end())
2694 nPrinterPaperTray = aIt->second;
2697 awt::Size aPageSize;
2698 awt::Point aPagePos;
2699 awt::Size aPreferredPageSize;
2701 if (bIsSwSrcView || bPrintProspect)
2718 aTmpSize = pPrinter->GetPaperSize();
2720 pPrinter->GetMapMode(),
MapMode( MapUnit::Map100thMM ));
2721 aPageSize = awt::Size( aTmpSize.
Width(), aTmpSize.
Height() );
2730 aTmpSize = pVwSh->
GetPageSize( nPage, bIsSkipEmptyPages );
2735 if( bPrintProspect )
2741 if( aPageSize.Width < aPageSize.Height )
2743 aPreferredPageSize.Width = aPageSize.Height;
2744 aPreferredPageSize.Height = aPageSize.Width;
2752 aTmpSize = pVwSh->
GetPageSize( nPage, bIsSkipEmptyPages );
2763 if (aPreferredPageSize.Width && aPreferredPageSize.Height)
2766 aRenderer.realloc( nLen );
2767 auto pRenderer = aRenderer.getArray();
2768 pRenderer[ nLen - 1 ].Name =
"PreferredPageSize";
2769 pRenderer[ nLen - 1 ].Value <<= aPreferredPageSize;
2771 if (nPrinterPaperTray >= 0)
2774 aRenderer.realloc( nLen );
2775 auto pRenderer = aRenderer.getArray();
2776 pRenderer[ nLen - 1 ].Name =
"PrinterPaperTray";
2777 pRenderer[ nLen - 1 ].Value <<= nPrinterPaperTray;
2786 if ( pPagePrintSettings &&
2787 ( pPagePrintSettings->
GetRow() > 1 ||
2788 pPagePrintSettings->
GetCol() > 1 ) )
2791 sal_Int32 nLen = aRenderer.getLength();
2792 const sal_Int32 nRenderDataIdxStart = nLen;
2794 aRenderer.realloc( nLen );
2795 auto pRenderer = aRenderer.getArray();
2797 const sal_Int32 nRow = pPagePrintSettings->
GetRow();
2798 pRenderer[ nRenderDataIdxStart + 0 ].Name =
"NUpRows";
2799 pRenderer[ nRenderDataIdxStart + 0 ].Value <<= std::max<sal_Int32>( nRow, 1);
2800 const sal_Int32 nCol = pPagePrintSettings->
GetCol();
2801 pRenderer[ nRenderDataIdxStart + 1 ].Name =
"NUpColumns";
2802 pRenderer[ nRenderDataIdxStart + 1 ].Value <<= std::max<sal_Int32>( nCol, 1);
2803 pRenderer[ nRenderDataIdxStart + 2 ].Name =
"NUpPageMarginLeft";
2804 pRenderer[ nRenderDataIdxStart + 2 ].Value <<= pPagePrintSettings->
GetLeftSpace();
2805 pRenderer[ nRenderDataIdxStart + 3 ].Name =
"NUpPageMarginRight";
2806 pRenderer[ nRenderDataIdxStart + 3 ].Value <<= pPagePrintSettings->
GetRightSpace();
2807 pRenderer[ nRenderDataIdxStart + 4 ].Name =
"NUpPageMarginTop";
2808 pRenderer[ nRenderDataIdxStart + 4 ].Value <<= pPagePrintSettings->
GetTopSpace();
2809 pRenderer[ nRenderDataIdxStart + 5 ].Name =
"NUpPageMarginBottom";
2810 pRenderer[ nRenderDataIdxStart + 5 ].Value <<= pPagePrintSettings->
GetBottomSpace();
2811 pRenderer[ nRenderDataIdxStart + 6 ].Name =
"NUpHorizontalSpacing";
2812 pRenderer[ nRenderDataIdxStart + 6 ].Value <<= pPagePrintSettings->
GetHorzSpace();
2813 pRenderer[ nRenderDataIdxStart + 7 ].Name =
"NUpVerticalSpacing";
2814 pRenderer[ nRenderDataIdxStart + 7 ].Value <<= pPagePrintSettings->
GetVertSpace();
2819 awt::Size aNewPageSize;
2821 aNewPageSize = awt::Size( aPageSize.
Width(), aPageSize.
Height() );
2827 aNewPageSize = awt::Size( aPageSize.
Height(), aPageSize.
Width() );
2829 pRenderer[ nRenderDataIdxStart + 8 ].Name =
"NUpPaperSize";
2830 pRenderer[ nRenderDataIdxStart + 8 ].Value <<= aNewPageSize;
2844 bool &rbIsSwSrcView,
2845 const uno::Reference< css::frame::XController >& rController )
2851 SwView *pSwView =
nullptr;
2862 pSwView =
dynamic_cast< SwView *
>(pView);
2863 pSwSrcView =
dynamic_cast< SwSrcView *
>(pView);
2864 if (!pSwPagePreview)
2866 if (rController.is())
2871 else if (pSwView || pSwSrcView)
2876 OSL_ENSURE( pSwView || pSwPagePreview || pSwSrcView,
"failed to get view shell" );
2878 rbIsSwSrcView = pSwSrcView !=
nullptr;
2883 sal_Int32 nRenderer,
2885 const uno::Sequence< beans::PropertyValue >& rxOptions )
2890 throw DisposedException( OUString(),
2891 static_cast< XTextDocument*
>(
this) );
2898 throw IllegalArgumentException();
2903 const bool bHasPDFExtOutDevData =
lcl_SeqHasProperty( rxOptions,
"HasPDFExtOutDevData" );
2904 const bool bIsPDFExport = !
lcl_SeqHasProperty( rxOptions,
"IsPrinter" ) || bHasPDFExtOutDevData;
2905 bool bIsSwSrcView =
false;
2908 OSL_ENSURE(
m_pRenderData,
"data should have been created already in getRendererCount..." );
2909 OSL_ENSURE(
m_pPrintUIOptions,
"data should have been created already in getRendererCount..." );
2919 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2922 sal_Int32 nMaxRenderer = 0;
2926 nMaxRenderer = bPrintProspect?
2927 m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
2932 if (bIsSwSrcView || nRenderer <= nMaxRenderer)
2938 rSwSrcView.
PrintSource(pOutDev, nRenderer + 1,
false);
2946 const SwView* pSwView =
dynamic_cast<const SwView*
>(pView);
2963 "SwView / SwViewOptionAdjust_Impl availability mismatch" );
2979 if (bIsPDFExport && (bFirstPage || bHasPDFExtOutDevData) && pWrtShell)
2999 if (bIsPDFExport && bLastPage && pWrtShell)
3047 throw DisposedException( OUString(),
static_cast< XTextDocument*
>(
this ) );
3057 throw DisposedException(
"SwXTextDocument not valid",
3058 static_cast<XTextDocument*
>(
this));
3069 throw DisposedException(
"",
static_cast< XTextDocument*
>(
this));
3076 uno::Reference< frame::XModel > xNewModel = pShell->GetModel();
3078 uno::Sequence< beans::PropertyValue > aTempMediaDescriptor;
3079 storeToStorage( xNewStorage, aTempMediaDescriptor );
3080 uno::Reference< document::XStorageBasedDocument > xStorageDoc( xNewModel, uno::UNO_QUERY );
3081 xStorageDoc->loadFromStorage( xNewStorage, aTempMediaDescriptor );
3082 return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY );
3089 if (
IsValid() && xListener.is())
3094 const uno::Reference<text::XPasteListener>& xListener)
3098 if (
IsValid() && xListener.is())
3103 int nOutputWidth,
int nOutputHeight,
3104 int nTilePosX,
int nTilePosY,
3108 pViewShell->
PaintTile(rDevice, nOutputWidth, nOutputHeight,
3109 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3112 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3132 pWrtShell->
GotoPage(nPart + 1,
true);
3177 if (pSdrView->GetTextEditObject())
3190 pView->ForcePageUpDownOffset(2 * rRectangle.
GetHeight() / 3);
3195 pViewShell->setLOKVisibleArea(rRectangle);
3200 int nTileTwipWidth_,
int )
3211 double fScale = 100.0 * nTilePixelWidth_ / nTileTwipWidth_
3214 if (aOption.
GetZoom() != fScale)
3231 return PointerStyle::Arrow;
3238 auto redlinesNode = rJson.
startArray(
"redlines");
3241 static bool bDisableRedlineComments = getenv(
"DISABLE_REDLINE") !=
nullptr;
3242 if (bDisableRedlineComments)
3250 rJson.
put(
"index", rRedlineTable[
i]->
GetId());
3251 rJson.
put(
"author", rRedlineTable[
i]->GetAuthorString(1));
3253 rRedlineTable[
i]->GetRedlineData().GetType()));
3254 rJson.
put(
"comment",
3255 rRedlineTable[
i]->GetRedlineData().GetComment());
3256 rJson.
put(
"description", rRedlineTable[
i]->GetDescr());
3258 rRedlineTable[
i]->GetRedlineData().GetTimeStamp().GetUNODateTime());
3259 rJson.
put(
"dateTime", sDateTime);
3261 SwContentNode* pContentNd = rRedlineTable[
i]->GetPointContentNode();
3263 if (pView && pContentNd)
3267 aCursor.
GetMark()->
Assign(*pContentNd, rRedlineTable[
i]->
End()->GetContentIndex());
3272 std::vector<OString> aRects;
3273 for (
const SwRect& rNextRect : *pRects)
3274 aRects.push_back(rNextRect.SVRect().toString());
3277 rJson.
put(
"textRange", sRects);
3284 SW_MOD()->GetRedlineAuthorInfo(rJsonWriter);
3296 auto commentsNode = rJsonWriter.
startArray(
"comments");
3310 aRect.
Pos().getX() + aRect.
SSize().Width(),
3311 aRect.
Pos().getY() + aRect.
SSize().Height());
3313 if (!sidebarItem->maLayoutInfo.mPositionFromCommentAnchor)
3319 std::vector<OString> aRects;
3322 const SwRect rect(aRange.getMinX(), aRange.getMinY(), aRange.getWidth(), aRange.getHeight());
3330 rJsonWriter.
put(
"author", pField->
GetPar1());
3332 rJsonWriter.
put(
"resolved", pField->
GetResolved() ?
"true" :
"false");
3335 rJsonWriter.
put(
"textRange", sRects);
3342 if (aIter ==
aArguments.end() || aIter->second !=
"drop-down")
3346 if (aIter ==
aArguments.end() || aIter->second !=
"selected")
3353 sal_Int32 nSelection = aIter->second.toInt32();
3363 if (nSelection >= 0)
3366 pFieldBM->Invalidate();
3373std::vector<basegfx::B2DRange>
3378 return std::vector<basegfx::B2DRange>();
3386 return std::vector<basegfx::B2DRange>();
3391inline constexpr OUStringLiteral SELECTED_DATE_FORMAT =
u"YYYY-MM-DD";
3396 auto it = rArguments.find(
"type");
3397 if (it == rArguments.end())
3402 if (it->second ==
"drop-down")
3419 auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
3421 std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.
GetContentControl();
3422 if (!pContentControl->GetComboBox() && !pContentControl->GetDropDown())
3427 it = rArguments.find(
"selected");
3428 if (it == rArguments.end())
3433 sal_Int32 nSelection = it->second.toInt32();
3434 pContentControl->SetSelectedListItem(nSelection);
3437 else if (it->second ==
"picture")
3439 it = rArguments.find(
"changed");
3440 if (it == rArguments.end())
3454 SfxCallMode::SYNCHRON, { &aItem });
3456 else if (it->second ==
"date")
3473 auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
3476 std::shared_ptr<SwContentControl> pContentControl
3478 if (!pContentControl->GetDate())
3483 it = rArguments.find(
"selected");
3484 if (it == rArguments.end())
3489 OUString aSelectedDate = it->second.replaceAll(
"T00:00:00Z",
"");
3496 sal_Int32 nCheckPos = 0;
3498 OUString sFormat = SELECTED_DATE_FORMAT;
3507 double dCurrentDate = 0;
3508 pNumberFormatter->
IsNumberFormat(aSelectedDate, nFormat, dCurrentDate);
3509 pContentControl->SetSelectedDate(dCurrentDate);
3527 return SwResId(STR_PAGE) + OUString::number(nPart + 1);
3532 OUString sPart(
SwResId(STR_PAGE) + OUString::number(nPart + 1));
3534 return OUString::number(sPart.hashCode());
3569 OUString sOrigAuthor =
SW_MOD()->GetRedlineAuthor(
SW_MOD()->GetRedlineAuthor());
3572 for (
const beans::PropertyValue& rValue : rArguments)
3574 if (rValue.Name ==
".uno:HideWhitespace" && rValue.Value.has<
bool>())
3576 else if (rValue.Name ==
".uno:ShowBorderShadow" && rValue.Value.has<
bool>())
3578 else if (rValue.Name ==
".uno:Author" && rValue.Value.has<OUString>())
3580 sAuthor = rValue.Value.get<OUString>();
3588 else if (rValue.Name ==
".uno:SpellOnline" && rValue.Value.has<
bool>())
3592 if (!sAuthor.isEmpty() && sAuthor != sOrigAuthor)
3599 pShell->SwViewShell::UpdateFields(
true);
3600 pShell->ResetModified();
3628 officecfg::Office::Common::Save::Document::WarnAlienFormat::set(
false, xChanges);
3665 MouseEventModifiers::SIMPLECLICK,
3666 nButtons, nModifier);
3682 case LOK_SETTEXTSELECTION_START:
3685 case LOK_SETTEXTSELECTION_END:
3688 case LOK_SETTEXTSELECTION_RESET:
3701 uno::Reference<datatransfer::XTransferable> xTransferable;
3706 if (pSdrView->GetTextEditObject())
3709 EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView();
3719 EditView& rEditView = pWin->GetOutlinerView()->GetEditView();
3724 if (!xTransferable.is() && pWrtShell)
3727 return xTransferable;
3746 case LOK_SETGRAPHICSELECTION_START:
3749 case LOK_SETGRAPHICSELECTION_END:
3766void 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 )
3771 sal_Int64 nWindowHandle;
3772 Parent >>= nWindowHandle;
3773 aData.hWnd =
reinterpret_cast<HWND
>(nWindowHandle);
3775 paintTile(*xDevice, nOutputWidth, nOutputHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3780 (void)nOutputHeight;
3792 ::sal_Int16 nScriptTypes,
3793 ::sal_Int16 nMaxCount )
3799 const sal_Int16 nLatin = 0x001;
3800 const sal_Int16 nAsian = 0x002;
3801 const sal_Int16 nComplex = 0x004;
3804 const bool bLatin = 0 != (nScriptTypes & nLatin);
3805 const bool bAsian = 0 != (nScriptTypes & nAsian);
3806 const bool bComplex = 0 != (nScriptTypes & nComplex);
3808 if (nScriptTypes < nLatin || nScriptTypes > (nLatin | nAsian | nComplex))
3809 throw IllegalArgumentException(
"nScriptTypes ranges from 1 to 7!", Reference< XInterface >(), 1);
3811 throw DisposedException();
3815 std::set< LanguageType > aAllLangs;
3820 for(
size_t i = 0;
i < pFormats->
size(); ++
i)
3822 const SwAttrSet &rAttrSet = (*pFormats)[
i]->GetAttrSet();
3828 aAllLangs.insert(
nLang );
3834 aAllLangs.insert(
nLang );
3840 aAllLangs.insert(
nLang );
3845 for (
size_t i = 0;
i < pColls->
size(); ++
i)
3847 const SwAttrSet &rAttrSet = (*pColls)[
i]->GetAttrSet();
3853 aAllLangs.insert(
nLang );
3859 aAllLangs.insert(
nLang );
3865 aAllLangs.insert(
nLang );
3877 std::vector< std::shared_ptr<SfxItemSet> > rStyles;
3879 while (!rStyles.empty())
3881 std::shared_ptr<SfxItemSet> pStyle = rStyles.back();
3891 aAllLangs.insert(
nLang );
3898 aAllLangs.insert(
nLang );
3905 aAllLangs.insert(
nLang );
3920 sal_Int32 nParCount = pOutliner->GetParagraphCount();
3921 for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
3924 std::vector<sal_Int32> aPortions;
3927 for (
size_t nPos = aPortions.size();
nPos; )
3931 sal_Int32 nEnd = aPortions[
nPos ];
3932 sal_Int32 nStart =
nPos ? aPortions[
nPos - 1 ] : 0;
3933 ESelection aSelection( nPar, nStart, nPar, nEnd );
3941 aAllLangs.insert(
nLang );
3947 aAllLangs.insert(
nLang );
3953 aAllLangs.insert(
nLang );
3960 if (nMaxCount >
static_cast< sal_Int16
>( aAllLangs.size() ))
3961 nMaxCount =
static_cast< sal_Int16
>( aAllLangs.size() );
3964 uno::Sequence< lang::Locale > aLanguages( nMaxCount );
3965 lang::Locale* pLanguage = aLanguages.getArray();
3969 for (
const auto& rLang : aAllLangs)
4014 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4021 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4028 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4035 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4042 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4049 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4056 aRet <<= Reference< XPropertySet >(xBkms, UNO_QUERY);
4063 aRet <<= Reference<XPropertySet>(xDrawingObjects, UNO_QUERY);
4066 throw NoSuchElementException();
4109 return "SwXLinkTargetSupplier";
4119 Sequence< OUString > aRet {
"com.sun.star.document.LinkTargets" };
4124 Reference< XNameAccess >
const & xAccess, OUString aLinkDisplayName, OUString sSuffix ) :
4125 m_xRealAccess(xAccess),
4128 m_sLinkDisplayName(
std::move(aLinkDisplayName)),
4134 OUString aLinkDisplayName, OUString sSuffix) :
4137 m_sLinkDisplayName(
std::move(aLinkDisplayName)),
4149 bool bFound =
false;
4151 OUString sParam = rName;
4153 if(sParam.getLength() >
sSuffix.getLength() )
4155 std::u16string_view sCmp = sParam.subView(sParam.getLength() -
sSuffix.getLength(),
4161 sParam = sParam.copy(0, sParam.getLength() -
sSuffix.getLength());
4170 for (
size_t i = 0;
i < nOutlineCount && !bFound; ++
i)
4174 OUString sOutlineText =
4178 Reference<XPropertySet> xOutline =
4185 else if (
sSuffix ==
"|drawingobject")
4194 if (sParam == pObj->
GetName())
4197 aRet <<= xDrawingObject;
4207 Reference< XInterface > xInt;
4208 if(!(aRet >>= xInt))
4210 Reference< XPropertySet > xProp(xInt, UNO_QUERY);
4217 throw NoSuchElementException();
4223 Sequence< OUString > aRet;
4232 const size_t nOutlineCount = rOutlineNodes.
size();
4233 aRet.realloc(nOutlineCount);
4234 OUString* pResArr = aRet.getArray();
4235 for (
size_t i = 0;
i < nOutlineCount; ++
i)
4238 pResArr[
i] = sEntry;
4248 aRet.realloc(nObjCount);
4249 OUString* pResArr = aRet.getArray();
4251 for (
size_t i = 0;
i < nObjCount; ++
i)
4254 if (!pObj->
GetName().isEmpty())
4255 pResArr[j++] = pObj->
GetName() +
"|drawingobject";
4262 const Sequence< OUString > aOrg =
m_xRealAccess->getElementNames();
4263 aRet.realloc(aOrg.getLength());
4264 std::transform(aOrg.begin(), aOrg.end(), aRet.getArray(),
4265 [
this](
const OUString& rOrg) -> OUString { return rOrg + m_sLinkSuffix; });
4273 OUString sParam(rName);
4276 std::u16string_view sCmp = sParam.subView(sParam.getLength() -
m_sLinkSuffix.getLength(),
4280 sParam = sParam.copy(0, sParam.getLength() -
m_sLinkSuffix.getLength());
4290 for (
size_t i = 0;
i < nOutlineCount && !bRet; ++
i)
4305 for (
size_t i = 0;
i < nObjCount && !bRet; ++
i)
4332 OSL_FAIL(
"not implemented");
4348 const OUString& rPropName,
const Any& )
4350 throw UnknownPropertyException(rPropName);
4356 if(!sLinkSuffix.empty())
4357 sLinkSuffix = sLinkSuffix.substr(1);
4360 if(sLinkSuffix ==
u"outline")
4361 sImgId = RID_BMP_NAVI_OUTLINE;
4362 else if(sLinkSuffix ==
u"table")
4363 sImgId = RID_BMP_NAVI_TABLE;
4364 else if(sLinkSuffix ==
u"frame")
4365 sImgId = RID_BMP_NAVI_FRAME;
4366 else if(sLinkSuffix ==
u"graphic")
4367 sImgId = RID_BMP_NAVI_GRAPHIC;
4368 else if(sLinkSuffix ==
u"ole")
4369 sImgId = RID_BMP_NAVI_OLE;
4370 else if(sLinkSuffix.empty())
4371 sImgId = RID_BMP_NAVI_BOOKMARK;
4372 else if(sLinkSuffix ==
u"region")
4373 sImgId = RID_BMP_NAVI_REGION;
4374 else if(sLinkSuffix ==
u"drawingobject")
4375 sImgId = RID_BMP_NAVI_DRAWOBJECT;
4377 if (!sImgId.isEmpty())
4396 throw UnknownPropertyException(rPropertyName);
4401 const OUString& ,
const Reference< XPropertyChangeListener > & )
4405 const OUString& ,
const Reference< XPropertyChangeListener > & )
4409 const OUString& ,
const Reference< XVetoableChangeListener > & )
4413 const OUString& ,
const Reference< XVetoableChangeListener > & )
4423 return "SwXLinkNameAccessWrapper";
4433 Sequence< OUString > aRet {
"com.sun.star.document.LinkTargets" };
4438 const sal_Int32 nOutlineLevel) :
4440 m_sOutlineText(
std::move(aOutlineText)),
4441 m_sActualText(
std::move(aActualText)),
4442 m_nOutlineLevel(nOutlineLevel)
4457 const OUString& rPropertyName,
const Any& )
4459 throw UnknownPropertyException(rPropertyName);
4465 rPropertyName !=
"OutlineLevel")
4466 throw UnknownPropertyException(rPropertyName);
4468 if (rPropertyName ==
"ActualOutlineName")
4471 if (rPropertyName ==
"OutlineLevel")
4478 const OUString& ,
const Reference< XPropertyChangeListener > & )
4483 const OUString& ,
const Reference< XPropertyChangeListener > & )
4488 const OUString& ,
const Reference< XVetoableChangeListener > & )
4493 const OUString& ,
const Reference< XVetoableChangeListener > & )
4499 return "SwXOutlineTarget";
4509 Sequence<OUString> aRet {
"com.sun.star.document.LinkTarget" };
4516 m_sDrawingObjectText(
std::move(aDrawingObjectText))
4531 const OUString& rPropertyName,
const Any& )
4533 throw UnknownPropertyException(rPropertyName);
4539 throw UnknownPropertyException(rPropertyName);
4545 const OUString& ,
const Reference< XPropertyChangeListener > & )
4550 const OUString& ,
const Reference< XPropertyChangeListener > & )
4555 const OUString& ,
const Reference< XVetoableChangeListener > & )
4560 const OUString& ,
const Reference< XVetoableChangeListener > & )
4566 return "SwXDrawingObjectTarget";
4576 Sequence<OUString> aRet {
"com.sun.star.document.LinkTarget" };
4593 Reference<XInterface> xRet;
4635#if OSL_DEBUG_LEVEL > 0
4636 default: OSL_FAIL(
"which table?");
4665 , m_aOldViewOptions( rViewOptions )
4684 const bool bContainsHiddenFields = pFieldType && pFieldType->HasWriterListeners();
4686 const bool bContainsHiddenParagraphs = pFieldType && pFieldType->HasWriterListeners();
4688 const bool bContainsPlaceHolders = pFieldType && pFieldType->HasWriterListeners();
4698 aRenderViewOptions.
SetBlank(
false );
4700 aRenderViewOptions.
SetTab(
false );
4706 if (bContainsHiddenChars)
4708 if (bContainsHiddenFields)
4710 if (bContainsHiddenParagraphs)
4713 if (bContainsPlaceHolders)
4720 if (bContainsFields)
4729 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 * getFieldmarkFor(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)
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()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
static SfxViewFrame * LoadHiddenDocument(SfxObjectShell const &i_rDoc, SfxInterfaceId i_nViewId)
css::uno::Reference< css::frame::XController > GetController() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
SfxViewFrame * GetViewFrame() const
virtual SfxObjectShell * GetObjectShell() override
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
SfxInPlaceClient * GetIPClient() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static OUString GetLanguageString(const LanguageType eType)
SvxAutoCorrect * GetAutoCorrect()
static SvxAutoCorrCfg & Get()
SvxSwAutoFormatFlags & GetSwFlags()
virtual ::com::sun::star::uno::Reference<::com::sun::star::uno::XInterface > SAL_CALL createInstance(const OUString &ServiceSpecifier) override
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
LanguageType GetLanguage() const
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString &ServiceSpecifier, const css::uno::Sequence< css::uno::Any > &Arguments) override
std::shared_ptr< SvxForbiddenCharactersTable > mxForbiddenChars
const SvxLanguageItem & GetCJKLanguage(bool=true) const
const SvxLanguageItem & GetLanguage(bool=true) const
const SvxLanguageItem & GetCTLLanguage(bool=true) const
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
OUString getPageRectangles()
Implementation of lok::Document::getPartPageRectangles() for Writer.