21 #include <officecfg/Office/Common.hxx>
36 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
63 #include <unosrch.hxx>
66 #include <unoprnms.hxx>
80 #include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
81 #include <com/sun/star/lang/DisposedException.hpp>
82 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
83 #include <com/sun/star/lang/NoSupportException.hpp>
84 #include <com/sun/star/beans/PropertyAttribute.hpp>
85 #include <com/sun/star/beans/XFastPropertySet.hpp>
86 #include <com/sun/star/document/RedlineDisplayType.hpp>
87 #include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
88 #include <com/sun/star/frame/XController.hpp>
89 #include <com/sun/star/frame/XFrame.hpp>
90 #include <com/sun/star/script/XInvocation.hpp>
91 #include <com/sun/star/view/XSelectionSupplier.hpp>
98 #include <strings.hrc>
99 #include <bitmaps.hlst>
113 #include <drawdoc.hxx>
115 #include <osl/file.hxx>
150 #include <editeng/editeng.hxx>
177 using ::osl::FileBase;
186 const bool bWebDoc =
nullptr !=
dynamic_cast< const SwWebDocShell *
>(pDocShell);
187 const bool bSwSrcView =
nullptr !=
dynamic_cast< const SwSrcView *
>(pView);
188 const SwView * pSwView =
dynamic_cast< const SwView *
>(pView);
189 const bool bHasSelection = pSwView && pSwView->
HasSelection(
false );
196 sal_uInt16 nCurrentPage = 1;
205 else if (!bSwSrcView)
208 OSL_ENSURE(pPreview,
"Unexpected type of the view shell");
217 if (pFrame && !rPrintData.IsPrintEmptyPages())
219 sal_uInt16 nMax = nCurrentPage;
221 while (pPage && nMax-- > 0)
228 return std::make_unique<SwPrintUIOptions>( nCurrentPage, bWebDoc, bSwSrcView, bHasSelection, bHasPostIts, rPrintData );
238 if( USHRT_MAX != nId )
250 if( pFound == pToClose)
269 return theSwXTextDocumentUnoTunnelId.
getSeq();
274 if( comphelper::isUnoTunnelId<SwXTextDocument>(rId) )
278 if( comphelper::isUnoTunnelId<SfxObjectShell>(rId) )
291 Reference<XUnoTunnel> xNumTunnel;
292 aNumTunnel >>= xNumTunnel;
293 return (xNumTunnel.is()) ? xNumTunnel->getSomething(rId) : 0;
298 Any aRet = SwXTextDocumentBaseClass::queryInterface(rType);
299 if ( !aRet.hasValue() )
301 if ( !aRet.hasValue() &&
304 Reference<lang::XMultiServiceFactory> xTmp =
this;
307 if ( !aRet.hasValue() &&
310 Reference<tiledrendering::XTiledRenderable> xTmp =
this;
314 if ( !aRet.hasValue()
341 Sequence< uno::Type > aNumTypes;
347 Reference<XTypeProvider> xNumProv;
348 if(aNumProv >>= xNumProv)
350 aNumTypes = xNumProv->getTypes();
355 SwXTextDocumentBaseClass::getTypes(),
368 m_bObjectValid(pShell != nullptr),
369 m_pHiddenViewFrame(nullptr),
371 m_bApplyPagePrintSettingsFromXPagePrintable(
false )
386 Reference< XInterface > x0;
424 m_xNumFormatAgg->setDelegator(static_cast<cppu::OWeakObject*>(static_cast<SwXTextDocumentBaseClass*>(
this)));
430 Reference< XUnoTunnel > xNumTunnel;
431 aNumTunnel >>= xNumTunnel;
433 = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xNumTunnel);
434 OSL_ENSURE(pNumFormat,
"No number formatter available");
444 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
456 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
463 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
496 Reference< XInterface > xRef;
551 uno::Sequence< uno::Any > aArgs;
574 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
587 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
599 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
611 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
624 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
636 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
648 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
667 xCursor.set( static_cast<text::XWordCursor*>(pXTextCursor.get()) );
669 auto& rUnoCursor(pXTextCursor->GetCursor());
670 rUnoCursor.SetRemainInSection(
false);
677 Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY_THROW);
679 if (!
IsValid() || !(pSearch = comphelper::getFromUnoTunnel<SwXTextSearch>(xDescTunnel)))
680 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
682 Reference< XTextCursor > xCursor;
693 pUnoCursor->SetRemainInSection(
false);
708 nResult =
static_cast<sal_Int32
>(pUnoCursor->FindAttrs(aSearch, !pSearch->
m_bStyles,
709 eStart, eEnd, bCancel,
710 static_cast<FindRanges>(eRanges),
720 nResult = pUnoCursor->FindFormat(*pSearchColl,
721 eStart, eEnd, bCancel,
722 static_cast<FindRanges>(eRanges), pReplaceColl );
729 nResult = pUnoCursor->Find_Text(aSearchOpt,
false,
730 eStart, eEnd, bCancel,
731 static_cast<FindRanges>(eRanges),
734 return static_cast<sal_Int32
>(nResult);
746 Reference< XTextCursor > & xCursor,
749 Reference< XInterface >
const & xLastResult)
751 const auto pSearch = comphelper::getFromUnoTunnel<SwXTextSearch>(xDesc);
757 bool bParentInExtra =
false;
760 Reference<XUnoTunnel> xCursorTunnel( xLastResult, UNO_QUERY);
761 OTextCursorHelper* pPosCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
762 SwPaM* pCursor = pPosCursor ? pPosCursor->
GetPaM() :
nullptr;
765 *pUnoCursor->
GetPoint() = *pCursor->End();
766 pUnoCursor->DeleteMark();
770 SwXTextRange* pRange = comphelper::getFromUnoTunnel<SwXTextRange>(xCursorTunnel);
774 if(pUnoCursor->HasMark())
776 if(*pUnoCursor->GetPoint() < *pUnoCursor->GetMark())
777 pUnoCursor->Exchange();
778 pUnoCursor->DeleteMark();
781 const SwNode& rRangeNode = pUnoCursor->GetNode();
789 pSearch->FillSearchOptions( aSearchOpt );
808 for (
int nSearchProc = 0; nSearchProc < 2; ++nSearchProc)
811 if(pSearch->HasSearchAttributes())
819 pSearch->FillSearchItemSet(aSearch);
821 nResult =
static_cast<sal_Int32
>(pUnoCursor->FindAttrs(aSearch, !pSearch->m_bStyles,
822 eStart, eEnd, bCancel,
824 !pSearch->m_sSearchText.isEmpty() ? &aSearchOpt : nullptr ));
826 else if(pSearch->m_bStyles)
832 nResult =
static_cast<sal_Int32
>(pUnoCursor->FindFormat(*pSearchColl,
833 eStart, eEnd, bCancel,
834 eRanges, pReplaceColl ));
840 nResult =
static_cast<sal_Int32
>(pUnoCursor->Find_Text(aSearchOpt,
false,
841 eStart, eEnd, bCancel,
852 Reference< XIndexAccess >
856 Reference< XInterface > xTmp;
857 sal_Int32 nResult = 0;
858 Reference< XTextCursor > xCursor;
859 auto pResultCursor(
FindAny(xDesc, xCursor,
true, nResult, xTmp));
869 Reference< XInterface > xTmp;
870 sal_Int32 nResult = 0;
871 Reference< XTextCursor > xCursor;
872 auto pResultCursor(
FindAny(xDesc, xCursor,
false, nResult, xTmp));
875 Reference< XInterface > xRet;
878 const uno::Reference< text::XText > xParent =
880 *pResultCursor->GetPoint());
887 const Reference< util::XSearchDescriptor > & xDesc)
890 sal_Int32 nResult = 0;
891 Reference< XTextCursor > xCursor;
894 auto pResultCursor(
FindAny(xDesc, xCursor,
false, nResult, xStartAt));
897 Reference< XInterface > xRet;
900 const uno::Reference< text::XText > xParent =
902 *pResultCursor->GetPoint());
914 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
916 beans::PropertyValue* pArray = aSeq.getArray();
922 aVal <<= static_cast<sal_Int16>(aData.
GetRow());
923 pArray[0] = beans::PropertyValue(
"PageRows", -1, aVal, PropertyState_DIRECT_VALUE);
924 aVal <<= static_cast<sal_Int16>(aData.
GetCol());
925 pArray[1] = beans::PropertyValue(
"PageColumns", -1, aVal, PropertyState_DIRECT_VALUE);
927 pArray[2] = beans::PropertyValue(
"LeftMargin", -1, aVal, PropertyState_DIRECT_VALUE);
929 pArray[3] = beans::PropertyValue(
"RightMargin", -1, aVal, PropertyState_DIRECT_VALUE);
931 pArray[4] = beans::PropertyValue(
"TopMargin", -1, aVal, PropertyState_DIRECT_VALUE);
933 pArray[5] = beans::PropertyValue(
"BottomMargin", -1, aVal, PropertyState_DIRECT_VALUE);
935 pArray[6] = beans::PropertyValue(
"HoriMargin", -1, aVal, PropertyState_DIRECT_VALUE);
937 pArray[7] = beans::PropertyValue(
"VertMargin", -1, aVal, PropertyState_DIRECT_VALUE);
939 pArray[8] = beans::PropertyValue(
"IsLandscape", -1, aVal, PropertyState_DIRECT_VALUE);
947 TypeClass
eType = rValue.getValueType().getTypeClass();
950 if( eType == TypeClass_UNSIGNED_LONG )
955 bException = !(rValue >>= nVal);
957 nRet =
static_cast<sal_uInt32
>(nVal);
965 OUStringBuffer sEntry;
968 const SwTextNode * pTextNd = rOutlineNodes[ nIndex ]->GetTextNode();
978 sEntry.append( nVal );
983 sEntry.append(sOutlineText);
984 return sEntry.makeStringAndClear();
991 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
998 for(
const beans::PropertyValue& rProperty : aSettings)
1000 OUString
sName = rProperty.Name;
1001 const Any& rVal = rProperty.Value;
1004 if( sName ==
"PageRows" )
1006 if(!nVal || nVal > 0xff)
1008 aData.
SetRow(static_cast<sal_uInt8>(nVal));
1010 else if(sName ==
"PageColumns")
1012 if(!nVal || nVal > 0xff)
1014 aData.
SetCol(static_cast<sal_uInt8>(nVal));
1016 else if(sName ==
"LeftMargin")
1020 else if(sName ==
"RightMargin")
1024 else if(sName ==
"TopMargin")
1028 else if(sName ==
"BottomMargin")
1032 else if(sName ==
"HoriMargin")
1036 else if(sName ==
"VertMargin")
1040 else if(sName ==
"IsLandscape")
1062 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1069 for (
const beans::PropertyValue &rProp : xOptions )
1072 Any aValue( rProp.Value );
1078 if ( rProp.Value >>= sFileURL )
1081 OUString sSystemPath;
1082 FileBase::getSystemPathFromFileURL ( sFileURL, sSystemPath );
1083 aReq.AppendItem(
SfxStringItem( SID_FILE_NAME, sSystemPath ) );
1086 throw IllegalArgumentException();
1092 sal_Int32 nCopies = 0;
1094 aReq.AppendItem(
SfxInt16Item( SID_PRINT_COPIES, static_cast<sal_Int16>(nCopies) ) );
1102 throw IllegalArgumentException();
1103 aReq.AppendItem(
SfxBoolItem( SID_PRINT_COLLATE, *b ) );
1112 throw IllegalArgumentException();
1114 aReq.AppendItem(
SfxBoolItem( SID_PRINT_SORT, *b ) );
1121 if ( !(rProp.Value >>= sTmp) )
1122 throw IllegalArgumentException();
1141 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1153 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1165 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1177 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1189 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1201 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1213 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1225 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1237 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1249 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1261 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1274 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1282 uno::Reference<lang::XComponent> xTriggerInit( static_cast<cppu::OWeakObject*>(
m_xDrawPage.get()), uno::UNO_QUERY );
1289 class SwDrawPagesObj :
public cppu::WeakImplHelper<
1290 css::drawing::XDrawPages,
1291 css::lang::XServiceInfo>
1294 css::uno::Reference< css::drawing::XDrawPageSupplier > m_xDoc;
1296 SwDrawPagesObj(
const css::uno::Reference< css::drawing::XDrawPageSupplier >& rxDoc) : m_xDoc(rxDoc) {}
1299 virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
1300 insertNewByIndex(sal_Int32 )
override {
throw css::lang::NoSupportException(); }
1302 virtual void SAL_CALL
remove(
const css::uno::Reference< css::drawing::XDrawPage >& )
override
1304 throw css::lang::NoSupportException();
1308 virtual sal_Int32 SAL_CALL getCount()
override {
return 1; }
1310 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32
Index)
override
1313 throw css::lang::IndexOutOfBoundsException(
"Writer documents have only one DrawPage!");
1314 return css::uno::Any(m_xDoc->getDrawPage());
1318 virtual css::uno::Type SAL_CALL getElementType()
override
1323 virtual sal_Bool SAL_CALL hasElements()
override {
return true; }
1328 return "SwDrawPagesObj";
1338 return {
"com.sun.star.drawing.DrawPages" };
1349 return new SwDrawPagesObj(
this);
1359 Reference< XUnoTunnel > xNumTunnel;
1360 aNumTunnel >>= xNumTunnel;
1362 = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xNumTunnel);
1363 OSL_ENSURE(pNumFormat,
"No number formatter available");
1366 OSL_ENSURE(pNumFormat,
"No number formatter available");
1370 lang::EventObject
const ev(static_cast<SwXTextDocumentBaseClass &>(*
this));
1371 std::unique_lock aGuard(
m_pImpl->m_Mutex);
1372 m_pImpl->m_RefreshListeners.disposeAndClear(aGuard, ev);
1420 Reference< XUnoTunnel > xNumTunnel;
1421 aNumTunnel >>= xNumTunnel;
1423 = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(xNumTunnel);
1424 OSL_ENSURE(pNumFormat,
"No number formatter available");
1560 OUString
const & rServiceName,
1561 css::uno::Sequence<css::uno::Any>
const * arguments)
1565 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1572 if (rServiceName ==
"com.sun.star.drawing.DashTable")
1576 if (rServiceName ==
"com.sun.star.drawing.GradientTable")
1580 if (rServiceName ==
"com.sun.star.drawing.HatchTable")
1584 if (rServiceName ==
"com.sun.star.drawing.BitmapTable")
1588 if (rServiceName ==
"com.sun.star.drawing.TransparencyGradientTable")
1592 if (rServiceName ==
"com.sun.star.drawing.MarkerTable")
1596 if (rServiceName ==
"com.sun.star.drawing.Defaults")
1600 if (rServiceName ==
"com.sun.star.document.Settings")
1604 if (rServiceName ==
"com.sun.star.document.ImportEmbeddedObjectResolver")
1608 *
m_pDocShell, SvXMLEmbeddedObjectHelperMode::Read));
1610 if (rServiceName ==
"com.sun.star.text.DocumentSettings")
1614 if (rServiceName ==
"com.sun.star.chart2.data.DataProvider")
1616 return Reference<XInterface>(
1617 static_cast<chart2::data::XDataProvider *
>(
1619 GetChartDataProvider()));
1621 if (!rServiceName.startsWith(
"com.sun.star.")
1622 || rServiceName.endsWith(
".OLE2Shape"))
1629 throw ServiceNotRegisteredException();
1634 OUString aTmpServiceName(rServiceName);
1635 if (rServiceName ==
"com.sun.star.drawing.temporaryForXMLImportOLE2Shape")
1637 aTmpServiceName =
"com.sun.star.drawing.OLE2Shape";
1639 Reference<XInterface> xTmp(
1640 arguments ==
nullptr
1643 aTmpServiceName, *arguments));
1644 if (rServiceName ==
"com.sun.star.drawing.GroupShape"
1645 || rServiceName ==
"com.sun.star.drawing.Shape3DSceneObject")
1649 if (rServiceName.startsWith(
"com.sun.star.drawing."))
1658 return create(rServiceName,
nullptr);
1662 const OUString& ServiceSpecifier,
1663 const Sequence< Any >& Arguments)
1665 return create(ServiceSpecifier, &Arguments);
1671 if ( !aServices.hasElements() )
1677 auto nLength = aRet.getLength();
1678 aRet.getArray()[
i] = aRet[
nLength - 1];
1690 return "SwXTextDocument";
1709 bool bTextDoc = (!bWebDoc && !bGlobalDoc);
1712 OUString* pArray = aRet.getArray();
1714 pArray[0] =
"com.sun.star.document.OfficeDocument";
1715 pArray[1] =
"com.sun.star.text.GenericTextDocument";
1718 pArray[2] =
"com.sun.star.text.TextDocument";
1720 pArray[2] =
"com.sun.star.text.WebDocument";
1721 else if (bGlobalDoc)
1722 pArray[2] =
"com.sun.star.text.GlobalDocument";
1731 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1750 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1755 throw UnknownPropertyException(rPropertyName);
1756 if(pEntry->
nFlags & PropertyAttribute::READONLY)
1757 throw PropertyVetoException();
1758 switch(pEntry->
nWID)
1765 static_cast< cppu::OWeakObject * >(
1766 static_cast< SwXTextDocumentBaseClass * >(
this)));
1771 SW_MOD()->GetModuleConfig()->SetWordDelimiter(sDelim);
1777 bool bSet = *o3tl::doAccess<bool>(aValue);
1794 Sequence <sal_Int8> aNew;
1799 if(aNew.hasElements())
1816 SW_MOD()->GetModuleConfig()->SetHideFieldTips(*o3tl::doAccess<bool>(aValue));
1829 case RedlineDisplayType::
1832 default:
throw IllegalArgumentException();
1839 sal_Int16 nYear = 0;
1849 bool bAuto = *o3tl::doAccess<bool>(aValue);
1851 if (
nullptr != pDrawDoc )
1869 bool bMode = *o3tl::doAccess<bool>(aValue);
1871 if (
nullptr != pDrawDoc )
1893 if( aValue >>= bBool )
1903 if (aValue >>= bBool)
1920 bool bDefaultPageMode(
false );
1921 aValue >>= bDefaultPageMode;
1926 setGrabBagItem(aValue);
1932 std::unique_ptr<SfxPoolItem> pNewItem(rItem.
Clone());
1943 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
1948 throw UnknownPropertyException(rPropertyName);
1950 switch(pEntry->
nWID)
1961 switch(pEntry->
nWID)
1972 aAny <<=
SW_MOD()->GetDocStatWordDelim();
2001 aAny <<=
SW_MOD()->GetModuleConfig()->IsHideFieldTips();
2011 nRet = RedlineDisplayType::REMOVED;
2012 else if(RedlineFlags::ShowMask == eRedMode)
2013 nRet = RedlineDisplayType::INSERTED_AND_REMOVED;
2033 if (
nullptr != pDrawDoc )
2044 if (
nullptr != pDrawDoc )
2064 aAny <<= OUString(
"ThisWordDoc" );
2068 aAny <<= getRuntimeUID();
2077 aAny <<= hasValidSignatures();
2080 getGrabBagItem(aAny);
2093 const Reference< XPropertyChangeListener > & )
2095 OSL_FAIL(
"not implemented");
2099 const Reference< XPropertyChangeListener > & )
2101 OSL_FAIL(
"not implemented");
2105 const Reference< XVetoableChangeListener > & )
2107 OSL_FAIL(
"not implemented");
2111 const Reference< XVetoableChangeListener > & )
2113 OSL_FAIL(
"not implemented");
2138 lang::EventObject
const ev(static_cast<SwXTextDocumentBaseClass &>(*
this));
2139 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2140 m_pImpl->m_RefreshListeners.notifyEach(aGuard,
2141 & util::XRefreshListener::refreshed, ev);
2148 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
2157 const Reference<util::XRefreshListener> & xListener)
2161 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2162 m_pImpl->m_RefreshListeners.addInterface(aGuard, xListener);
2167 const Reference<util::XRefreshListener> & xListener)
2171 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2172 m_pImpl->m_RefreshListeners.removeInterface(aGuard, xListener);
2180 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
2196 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
2200 throw UnknownPropertyException(rPropertyName);
2201 return PropertyState_DIRECT_VALUE;
2206 const sal_Int32
nCount = rPropertyNames.getLength();
2207 Sequence < PropertyState > aRet ( nCount );
2209 std::transform(rPropertyNames.begin(), rPropertyNames.end(), aRet.getArray(),
2210 [
this](
const OUString& rName) -> PropertyState {
return getPropertyState(rName); });
2219 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
2223 throw UnknownPropertyException(rPropertyName);
2224 switch(pEntry->
nWID)
2226 case 0:
default:
break;
2234 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
2238 throw UnknownPropertyException(rPropertyName);
2240 switch(pEntry->
nWID)
2242 case 0:
default:
break;
2252 uno::Reference< awt::XDevice > xRenderDevice;
2253 aAny >>= xRenderDevice;
2254 if (xRenderDevice.is())
2256 VCLXDevice* pDevice = comphelper::getFromUnoTunnel<VCLXDevice>( xRenderDevice );
2264 const uno::Sequence< beans::PropertyValue >& rOptions,
2265 const char *pPropName )
2267 return std::any_of(rOptions.begin(), rOptions.end(),
2268 [&pPropName](
const beans::PropertyValue& rProp) {
2269 return rProp.Name.equalsAscii( pPropName ); });
2273 const uno::Sequence< beans::PropertyValue >& rOptions,
2274 const char *pPropName )
2277 auto pOption = std::find_if(rOptions.begin(), rOptions.end(),
2278 [&pPropName](
const beans::PropertyValue& rProp) {
2279 return rProp.Name.equalsAscii( pPropName ); });
2280 if (pOption != rOptions.end())
2281 pOption->Value >>= bRes;
2286 bool &rbIsSwSrcView,
2287 const uno::Sequence< beans::PropertyValue >& rOptions,
2297 auto pOption = std::find_if(rOptions.begin(), rOptions.end(),
2298 [](
const beans::PropertyValue& rProp) {
return rProp.Name ==
"View"; });
2299 if (pOption != rOptions.end())
2300 aTmp = pOption->
Value;
2305 OSL_ENSURE(
xController.is(),
"controller is empty!" );
2325 SwDoc *pDoc =
nullptr;
2327 uno::Reference< frame::XModel >
xModel;
2328 rSelection >>= xModel;
2333 OSL_ENSURE( !xModel.is(),
"unexpected model found" );
2342 bool bIsSwSrcView =
false;
2344 OSL_ENSURE( bIsPDFExport,
"view is missing, guessing one..." );
2348 OSL_ENSURE( rpView,
"SwViewShell missing" );
2352 if (
auto pSwView = dynamic_cast<SwView *>( rpView ))
2356 OSL_FAIL(
"GetRenderDoc: no renderdata");
2362 xDocSh = pSwView->CreateTmpSelectionDoc();
2367 pDoc =
static_cast<SwDocShell*
>(&xDocSh)->GetDoc();
2373 OSL_FAIL(
"unexpected SwViewShell" );
2388 aDocPrintData.SetPrintTable(
true );
2393 aDocPrintData.SetPrintReverse(
false );
2395 aDocPrintData.SetPrintEmptyPages( rPrintUIOptions.
IsPrintEmptyPages( bIsPDFEXport ) );
2411 const uno::Sequence< beans::PropertyValue >& rxOptions )
2416 throw DisposedException( OUString(),
2417 static_cast< XTextDocument* >(
this) );
2421 bool bIsSwSrcView =
false;
2431 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2432 if (!pDoc || !pView)
2443 nRet = rSwSrcView.
PrintSource( pOutDev, 1 ,
true );
2458 if ( bIsPDFExport && bFormat )
2466 pViewShell =
static_cast<SwPagePreview*
>(pView)->GetViewShell();
2469 if (!pViewShell || !pViewShell->
GetLayout())
2480 aOpt.SetHideWhitespaceMode(
false );
2512 bool setShowPlaceHoldersInPDF =
false;
2515 m_pRenderData->ViewOptionAdjust( pPrtOptions, setShowPlaceHoldersInPDF );
2528 bool bStateChanged =
false;
2533 bStateChanged =
true;
2535 pViewShell->SwViewShell::UpdateFields(
true);
2547 const sal_Int32 nPageCount = pViewShell->
GetPageCount();
2555 nRet =
m_pRenderData->GetPagePairsForProspectPrinting().size();
2573 *m_pPrintUIOptions, nPageCount );
2579 OSL_ENSURE( nRet >= 0,
"negative number of pages???" );
2589 sal_Int32 nRenderer,
2591 const uno::Sequence< beans::PropertyValue >& rxOptions )
2596 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
2600 bool bIsSwSrcView =
false;
2614 const bool bIsSkipEmptyPages = !
m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport );
2615 const bool bPrintPaperFromSetup =
m_pPrintUIOptions->getBoolValue(
"PrintPaperFromSetup" );
2618 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2619 if (!pDoc || !pView)
2620 return uno::Sequence< beans::PropertyValue >();
2626 throw IllegalArgumentException();
2636 sal_Int32 nMaxRenderer = 0;
2640 nMaxRenderer = bPrintProspect?
2641 m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
2646 if (!bIsSwSrcView &&
m_pRenderData && nRenderer > nMaxRenderer)
2647 return uno::Sequence< beans::PropertyValue >();
2649 uno::Sequence< beans::PropertyValue > aRenderer;
2656 const sal_Int32 nPage = bPrintProspect
2661 sal_Int32 nPrinterPaperTray = -1;
2662 if (! bPrintPaperFromSetup)
2665 const std::map< sal_Int32, sal_Int32 > &rPaperTrays =
m_pRenderData->GetPrinterPaperTrays();
2666 std::map< sal_Int32, sal_Int32 >::const_iterator aIt( rPaperTrays.find( nPage ) );
2667 if (aIt != rPaperTrays.end())
2668 nPrinterPaperTray = aIt->second;
2671 awt::Size aPageSize;
2672 awt::Point aPagePos;
2673 awt::Size aPreferredPageSize;
2675 if (bIsSwSrcView || bPrintProspect)
2695 aPageSize = awt::Size( aTmpSize.
Width(), aTmpSize.
Height() );
2704 aTmpSize = pVwSh->
GetPageSize( nPage, bIsSkipEmptyPages );
2709 if( bPrintProspect )
2715 if( aPageSize.Width < aPageSize.Height )
2717 aPreferredPageSize.Width = aPageSize.Height;
2718 aPreferredPageSize.Height = aPageSize.Width;
2726 aTmpSize = pVwSh->
GetPageSize( nPage, bIsSkipEmptyPages );
2737 if (aPreferredPageSize.Width && aPreferredPageSize.Height)
2740 aRenderer.realloc( nLen );
2741 auto pRenderer = aRenderer.getArray();
2742 pRenderer[ nLen - 1 ].Name =
"PreferredPageSize";
2743 pRenderer[ nLen - 1 ].Value <<= aPreferredPageSize;
2745 if (nPrinterPaperTray >= 0)
2748 aRenderer.realloc( nLen );
2749 auto pRenderer = aRenderer.getArray();
2750 pRenderer[ nLen - 1 ].Name =
"PrinterPaperTray";
2751 pRenderer[ nLen - 1 ].Value <<= nPrinterPaperTray;
2760 if ( pPagePrintSettings &&
2761 ( pPagePrintSettings->
GetRow() > 1 ||
2762 pPagePrintSettings->
GetCol() > 1 ) )
2765 sal_Int32 nLen = aRenderer.getLength();
2766 const sal_Int32 nRenderDataIdxStart = nLen;
2768 aRenderer.realloc( nLen );
2769 auto pRenderer = aRenderer.getArray();
2771 const sal_Int32 nRow = pPagePrintSettings->
GetRow();
2772 pRenderer[ nRenderDataIdxStart + 0 ].Name =
"NUpRows";
2773 pRenderer[ nRenderDataIdxStart + 0 ].Value <<= std::max<sal_Int32>( nRow, 1);
2774 const sal_Int32 nCol = pPagePrintSettings->
GetCol();
2775 pRenderer[ nRenderDataIdxStart + 1 ].Name =
"NUpColumns";
2776 pRenderer[ nRenderDataIdxStart + 1 ].Value <<= std::max<sal_Int32>( nCol, 1);
2777 pRenderer[ nRenderDataIdxStart + 2 ].Name =
"NUpPageMarginLeft";
2778 pRenderer[ nRenderDataIdxStart + 2 ].Value <<= pPagePrintSettings->
GetLeftSpace();
2779 pRenderer[ nRenderDataIdxStart + 3 ].Name =
"NUpPageMarginRight";
2780 pRenderer[ nRenderDataIdxStart + 3 ].Value <<= pPagePrintSettings->
GetRightSpace();
2781 pRenderer[ nRenderDataIdxStart + 4 ].Name =
"NUpPageMarginTop";
2782 pRenderer[ nRenderDataIdxStart + 4 ].Value <<= pPagePrintSettings->
GetTopSpace();
2783 pRenderer[ nRenderDataIdxStart + 5 ].Name =
"NUpPageMarginBottom";
2784 pRenderer[ nRenderDataIdxStart + 5 ].Value <<= pPagePrintSettings->
GetBottomSpace();
2785 pRenderer[ nRenderDataIdxStart + 6 ].Name =
"NUpHorizontalSpacing";
2786 pRenderer[ nRenderDataIdxStart + 6 ].Value <<= pPagePrintSettings->
GetHorzSpace();
2787 pRenderer[ nRenderDataIdxStart + 7 ].Name =
"NUpVerticalSpacing";
2788 pRenderer[ nRenderDataIdxStart + 7 ].Value <<= pPagePrintSettings->
GetVertSpace();
2793 awt::Size aNewPageSize;
2795 aNewPageSize = awt::Size( aPageSize.
Width(), aPageSize.
Height() );
2801 aNewPageSize = awt::Size( aPageSize.
Height(), aPageSize.
Width() );
2803 pRenderer[ nRenderDataIdxStart + 8 ].Name =
"NUpPaperSize";
2804 pRenderer[ nRenderDataIdxStart + 8 ].Value <<= aNewPageSize;
2818 bool &rbIsSwSrcView,
2819 const uno::Reference< css::frame::XController >& rController )
2825 SwView *pSwView =
nullptr;
2836 pSwView =
dynamic_cast< SwView *
>(pView);
2837 pSwSrcView =
dynamic_cast< SwSrcView *
>(pView);
2838 if (!pSwPagePreview)
2840 if (rController.is())
2845 else if (pSwView || pSwSrcView)
2850 OSL_ENSURE( pSwView || pSwPagePreview || pSwSrcView,
"failed to get view shell" );
2852 rbIsSwSrcView = pSwSrcView !=
nullptr;
2857 sal_Int32 nRenderer,
2859 const uno::Sequence< beans::PropertyValue >& rxOptions )
2864 throw DisposedException( OUString(),
2865 static_cast< XTextDocument* >(
this) );
2872 throw IllegalArgumentException();
2877 const bool bHasPDFExtOutDevData =
lcl_SeqHasProperty( rxOptions,
"HasPDFExtOutDevData" );
2878 const bool bIsPDFExport = !
lcl_SeqHasProperty( rxOptions,
"IsPrinter" ) || bHasPDFExtOutDevData;
2879 bool bIsSwSrcView =
false;
2882 OSL_ENSURE(
m_pRenderData,
"data should have been created already in getRendererCount..." );
2883 OSL_ENSURE(
m_pPrintUIOptions,
"data should have been created already in getRendererCount..." );
2893 OSL_ENSURE( pDoc && pView,
"doc or view shell missing!" );
2896 sal_Int32 nMaxRenderer = 0;
2900 nMaxRenderer = bPrintProspect?
2901 m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
2906 if (bIsSwSrcView || nRenderer <= nMaxRenderer)
2912 rSwSrcView.
PrintSource(pOutDev, nRenderer + 1,
false);
2920 const SwView* pSwView =
dynamic_cast<const SwView*
>(pView);
2937 "SwView / SwViewOptionAdjust_Impl availability mismatch" );
2954 if (bIsPDFExport && (bFirstPage || bHasPDFExtOutDevData) && pWrtShell)
2970 if (bIsPDFExport && bLastPage && pWrtShell)
3018 throw DisposedException( OUString(), static_cast< XTextDocument* >(
this ) );
3028 throw DisposedException(
"SwXTextDocument not valid",
3029 static_cast<XTextDocument*>(
this));
3040 throw DisposedException(
"", static_cast< XTextDocument* >(
this));
3047 uno::Reference< frame::XModel > xNewModel = pShell->
GetModel();
3049 uno::Sequence< beans::PropertyValue > aTempMediaDescriptor;
3050 storeToStorage( xNewStorage, aTempMediaDescriptor );
3051 uno::Reference< document::XStorageBasedDocument > xStorageDoc( xNewModel, uno::UNO_QUERY );
3052 xStorageDoc->loadFromStorage( xNewStorage, aTempMediaDescriptor );
3053 return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY );
3060 if (
IsValid() && xListener.is())
3065 const uno::Reference<text::XPasteListener>& xListener)
3069 if (
IsValid() && xListener.is())
3074 int nOutputWidth,
int nOutputHeight,
3075 int nTilePosX,
int nTilePosY,
3079 pViewShell->
PaintTile(rDevice, nOutputWidth, nOutputHeight,
3080 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3083 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3103 pWrtShell->
GotoPage(nPart + 1,
true);
3148 if (pSdrView->GetTextEditObject())
3161 pView->ForcePageUpDownOffset(2 * rRectangle.
GetHeight() / 3);
3166 pViewShell->setLOKVisibleArea(rRectangle);
3171 int nTileTwipWidth_,
int )
3182 double fScale = 100.0 * nTilePixelWidth_ / nTileTwipWidth_
3185 if (aOption.
GetZoom() != fScale)
3202 return PointerStyle::Arrow;
3209 auto redlinesNode = rJson.
startArray(
"redlines");
3212 static bool bDisableRedlineComments = getenv(
"DISABLE_REDLINE") !=
nullptr;
3213 if (bDisableRedlineComments)
3221 rJson.
put(
"index", rRedlineTable[
i]->
GetId());
3222 rJson.
put(
"author", rRedlineTable[
i]->GetAuthorString(1));
3224 rRedlineTable[
i]->GetRedlineData().GetType()));
3225 rJson.
put(
"comment",
3226 rRedlineTable[
i]->GetRedlineData().GetComment());
3227 rJson.
put(
"description", rRedlineTable[
i]->GetDescr());
3229 rRedlineTable[
i]->GetRedlineData().GetTimeStamp().GetUNODateTime());
3230 rJson.
put(
"dateTime", sDateTime);
3234 if (pView && pContentNd)
3240 rRedlineTable[
i]->
End()->nContent.GetIndex());
3245 std::vector<OString> aRects;
3246 for (
const SwRect& rNextRect : *pRects)
3247 aRects.push_back(rNextRect.SVRect().toString());
3250 rJson.
put(
"textRange", sRects);
3257 SW_MOD()->GetRedlineAuthorInfo(rJsonWriter);
3269 auto commentsNode = rJsonWriter.
startArray(
"comments");
3283 aRect.
Pos().getX() + aRect.
SSize().Width(),
3284 aRect.
Pos().getY() + aRect.
SSize().Height());
3286 if (!sidebarItem->maLayoutInfo.mPositionFromCommentAnchor)
3292 std::vector<OString> aRects;
3295 const SwRect rect(aRange.getMinX(), aRange.getMinY(), aRange.getWidth(), aRange.getHeight());
3296 aRects.push_back(rect.SVRect().toString());
3303 rJsonWriter.
put(
"author", pField->
GetPar1());
3305 rJsonWriter.
put(
"resolved", pField->
GetResolved() ?
"true" :
"false");
3307 rJsonWriter.
put(
"anchorPos", aSVRect.toString());
3308 rJsonWriter.
put(
"textRange", sRects);
3314 auto aIter = aArguments.find(
"type");
3315 if (aIter == aArguments.end() || aIter->second !=
"drop-down")
3318 aIter = aArguments.find(
"cmd");
3319 if (aIter == aArguments.end() || aIter->second !=
"selected")
3322 aIter = aArguments.find(
"data");
3323 if (aIter == aArguments.end())
3326 sal_Int32 nSelection = aIter->second.toInt32();
3336 if (nSelection >= 0)
3346 std::vector<basegfx::B2DRange>
3351 return std::vector<basegfx::B2DRange>();
3359 return std::vector<basegfx::B2DRange>();
3364 inline constexpr OUStringLiteral SELECTED_DATE_FORMAT =
u"YYYY-MM-DD";
3369 auto it = rArguments.find(
"type");
3370 if (it == rArguments.end())
3375 if (it->second ==
"drop-down")
3394 std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.GetContentControl();
3395 if (!pContentControl->HasListItems())
3400 it = rArguments.find(
"selected");
3401 if (it == rArguments.end())
3406 sal_Int32 nSelection = it->second.toInt32();
3407 pContentControl->SetSelectedListItem(nSelection);
3410 else if (it->second ==
"picture")
3412 it = rArguments.find(
"changed");
3413 if (it == rArguments.end())
3427 SfxCallMode::SYNCHRON, { &aItem });
3429 else if (it->second ==
"date")
3449 std::shared_ptr<SwContentControl> pContentControl
3450 = rFormatContentControl.GetContentControl();
3451 if (!pContentControl->GetDate())
3456 it = rArguments.find(
"selected");
3457 if (it == rArguments.end())
3462 OUString aSelectedDate = it->second.replaceAll(
"T00:00:00Z",
"");
3469 sal_Int32 nCheckPos = 0;
3471 OUString sFormat = SELECTED_DATE_FORMAT;
3480 double dCurrentDate = 0;
3481 pNumberFormatter->
IsNumberFormat(aSelectedDate, nFormat, dCurrentDate);
3482 pContentControl->SetSelectedDate(dCurrentDate);
3500 return SwResId(STR_PAGE) + OUString::number(nPart + 1);
3505 OUString sPart(
SwResId(STR_PAGE) + OUString::number(nPart + 1));
3507 return OUString::number(sPart.hashCode());
3545 for (
const beans::PropertyValue& rValue : rArguments)
3547 if (rValue.Name ==
".uno:HideWhitespace" && rValue.Value.has<
bool>())
3548 aViewOption.SetHideWhitespaceMode(rValue.Value.get<
bool>());
3549 else if (rValue.Name ==
".uno:ShowBorderShadow" && rValue.Value.has<
bool>())
3551 else if (rValue.Name ==
".uno:Author" && rValue.Value.has<OUString>())
3560 else if (rValue.Name ==
".uno:SpellOnline" && rValue.Value.has<
bool>())
3561 aViewOption.SetOnlineSpell(rValue.Value.get<
bool>());
3567 aViewOption.SetZoom(1 * 100);
3587 officecfg::Office::Common::Save::Document::WarnAlienFormat::set(
false, xChanges);
3620 nCount, nButtons, nModifier,
3624 nCount, nButtons, nModifier,
3630 if (nType != LOK_MOUSEEVENT_MOUSEMOVE)
3638 MouseEventModifiers::SIMPLECLICK,
3639 nButtons, nModifier);
3655 case LOK_SETTEXTSELECTION_START:
3658 case LOK_SETTEXTSELECTION_END:
3661 case LOK_SETTEXTSELECTION_RESET:
3674 uno::Reference<datatransfer::XTransferable> xTransferable;
3679 if (pSdrView->GetTextEditObject())
3682 EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView();
3692 EditView& rEditView = pWin->GetOutlinerView()->GetEditView();
3697 if (!xTransferable.is() && pWrtShell)
3700 return xTransferable;
3719 case LOK_SETGRAPHICSELECTION_START:
3722 case LOK_SETGRAPHICSELECTION_END:
3739 void 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 )
3744 sal_Int64 nWindowHandle;
3745 Parent >>= nWindowHandle;
3746 aData.hWnd =
reinterpret_cast<HWND
>(nWindowHandle);
3748 paintTile(*xDevice, nOutputWidth, nOutputHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight);
3753 (
void)nOutputHeight;
3765 ::sal_Int16 nScriptTypes,
3766 ::sal_Int16 nMaxCount )
3772 const sal_Int16 nLatin = 0x001;
3773 const sal_Int16 nAsian = 0x002;
3774 const sal_Int16 nComplex = 0x004;
3777 const bool bLatin = 0 != (nScriptTypes & nLatin);
3778 const bool bAsian = 0 != (nScriptTypes & nAsian);
3779 const bool bComplex = 0 != (nScriptTypes & nComplex);
3781 if (nScriptTypes < nLatin || nScriptTypes > (nLatin | nAsian | nComplex))
3782 throw IllegalArgumentException(
"nScriptTypes ranges from 1 to 7!", Reference< XInterface >(), 1);
3784 throw DisposedException();
3788 std::set< LanguageType > aAllLangs;
3793 for(
size_t i = 0;
i < pFormats->
size(); ++
i)
3795 const SwAttrSet &rAttrSet = (*pFormats)[
i]->GetAttrSet();
3801 aAllLangs.insert( nLang );
3807 aAllLangs.insert( nLang );
3813 aAllLangs.insert( nLang );
3818 for (
size_t i = 0;
i < pColls->
size(); ++
i)
3820 const SwAttrSet &rAttrSet = (*pColls)[
i]->GetAttrSet();
3826 aAllLangs.insert( nLang );
3832 aAllLangs.insert( nLang );
3838 aAllLangs.insert( nLang );
3850 std::vector< std::shared_ptr<SfxItemSet> > rStyles;
3852 while (!rStyles.empty())
3854 std::shared_ptr<SfxItemSet> pStyle = rStyles.back();
3864 aAllLangs.insert( nLang );
3871 aAllLangs.insert( nLang );
3878 aAllLangs.insert( nLang );
3893 sal_Int32 nParCount = pOutliner->GetParagraphCount();
3894 for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
3897 std::vector<sal_Int32> aPortions;
3900 for (
size_t nPos = aPortions.size();
nPos; )
3904 sal_Int32 nEnd = aPortions[
nPos ];
3905 sal_Int32 nStart =
nPos ? aPortions[
nPos - 1 ] : 0;
3906 ESelection aSelection( nPar, nStart, nPar, nEnd );
3914 aAllLangs.insert( nLang );
3920 aAllLangs.insert( nLang );
3926 aAllLangs.insert( nLang );
3933 if (nMaxCount > static_cast< sal_Int16 >( aAllLangs.size() ))
3934 nMaxCount =
static_cast< sal_Int16
>( aAllLangs.size() );
3937 uno::Sequence< lang::Locale > aLanguages( nMaxCount );
3938 lang::Locale* pLanguage = aLanguages.getArray();
3942 for (
const auto& rLang : aAllLangs)
3944 if (nCount >= nMaxCount)
3987 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
3994 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
3998 sSuffix +=
"region";
4001 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4005 sSuffix +=
"graphic";
4008 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4015 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4019 sSuffix +=
"outline";
4022 aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY);
4029 aRet <<= Reference< XPropertySet >(xBkms, UNO_QUERY);
4033 sSuffix +=
"drawingobject";
4036 aRet <<= Reference<XPropertySet>(xDrawingObjects, UNO_QUERY);
4039 throw NoSuchElementException();
4082 return "SwXLinkTargetSupplier";
4098 m_xRealAccess(xAccess),
4100 m_sLinkSuffix(sSuffix),
4101 m_sLinkDisplayName(rLinkDisplayName),
4107 const OUString& rLinkDisplayName,
const OUString& sSuffix) :
4109 m_sLinkSuffix(sSuffix),
4110 m_sLinkDisplayName(rLinkDisplayName),
4122 bool bFound =
false;
4124 OUString sParam = rName;
4126 if(sParam.getLength() > sSuffix.getLength() )
4128 std::u16string_view sCmp = sParam.subView(sParam.getLength() - sSuffix.getLength(),
4129 sSuffix.getLength());
4134 sParam = sParam.copy(0, sParam.getLength() - sSuffix.getLength());
4139 if (sSuffix ==
"|outline")
4143 for (
size_t i = 0;
i < nOutlineCount && !bFound; ++
i)
4147 OUString sOutlineText =
4158 else if (sSuffix ==
"|drawingobject")
4167 if (sParam == pObj->
GetName())
4170 aRet <<= xDrawingObject;
4179 aRet =
m_xRealAccess->getByName(sParam.copy(0, sParam.getLength() - sSuffix.getLength()));
4180 Reference< XInterface > xInt;
4181 if(!(aRet >>= xInt))
4190 throw NoSuchElementException();
4205 const size_t nOutlineCount = rOutlineNodes.
size();
4206 aRet.realloc(nOutlineCount);
4207 OUString* pResArr = aRet.getArray();
4208 for (
size_t i = 0;
i < nOutlineCount; ++
i)
4211 pResArr[
i] = sEntry;
4221 aRet.realloc(nObjCount);
4222 OUString* pResArr = aRet.getArray();
4224 for (
size_t i = 0;
i < nObjCount; ++
i)
4227 if (!pObj->
GetName().isEmpty())
4228 pResArr[j++] = pObj->
GetName() +
"|drawingobject";
4236 aRet.realloc(aOrg.getLength());
4237 std::transform(aOrg.begin(), aOrg.end(), aRet.getArray(),
4238 [
this](
const OUString& rOrg) -> OUString {
return rOrg +
m_sLinkSuffix; });
4246 OUString sParam(rName);
4249 std::u16string_view sCmp = sParam.subView(sParam.getLength() -
m_sLinkSuffix.getLength(),
4253 sParam = sParam.copy(0, sParam.getLength() -
m_sLinkSuffix.getLength());
4263 for (
size_t i = 0;
i < nOutlineCount && !bRet; ++
i)
4278 for (
size_t i = 0;
i < nObjCount && !bRet; ++
i)
4305 OSL_FAIL(
"not implemented");
4321 const OUString& rPropName,
const Any& )
4323 throw UnknownPropertyException(rPropName);
4329 if(!sLinkSuffix.empty())
4330 sLinkSuffix = sLinkSuffix.substr(1);
4333 if(sLinkSuffix ==
u"outline")
4334 sImgId = RID_BMP_NAVI_OUTLINE;
4335 else if(sLinkSuffix ==
u"table")
4336 sImgId = RID_BMP_NAVI_TABLE;
4337 else if(sLinkSuffix ==
u"frame")
4338 sImgId = RID_BMP_NAVI_FRAME;
4339 else if(sLinkSuffix ==
u"graphic")
4340 sImgId = RID_BMP_NAVI_GRAPHIC;
4341 else if(sLinkSuffix ==
u"ole")
4342 sImgId = RID_BMP_NAVI_OLE;
4343 else if(sLinkSuffix.empty())
4344 sImgId = RID_BMP_NAVI_BOOKMARK;
4345 else if(sLinkSuffix ==
u"region")
4346 sImgId = RID_BMP_NAVI_REGION;
4347 else if(sLinkSuffix ==
u"drawingobject")
4348 sImgId = RID_BMP_NAVI_DRAWOBJECT;
4350 if (!sImgId.isEmpty())
4369 throw UnknownPropertyException(rPropertyName);
4374 const OUString& ,
const Reference< XPropertyChangeListener > & )
4378 const OUString& ,
const Reference< XPropertyChangeListener > & )
4382 const OUString& ,
const Reference< XVetoableChangeListener > & )
4386 const OUString& ,
const Reference< XVetoableChangeListener > & )
4396 return "SwXLinkNameAccessWrapper";
4411 const sal_Int32 nOutlineLevel) :
4413 m_sOutlineText(rOutlineText),
4414 m_sActualText(rActualText),
4415 m_nOutlineLevel(nOutlineLevel)
4430 const OUString& rPropertyName,
const Any& )
4432 throw UnknownPropertyException(rPropertyName);
4438 rPropertyName !=
"OutlineLevel")
4439 throw UnknownPropertyException(rPropertyName);
4441 if (rPropertyName ==
"ActualOutlineName")
4444 if (rPropertyName ==
"OutlineLevel")
4451 const OUString& ,
const Reference< XPropertyChangeListener > & )
4456 const OUString& ,
const Reference< XPropertyChangeListener > & )
4461 const OUString& ,
const Reference< XVetoableChangeListener > & )
4466 const OUString& ,
const Reference< XVetoableChangeListener > & )
4472 return "SwXOutlineTarget";
4489 m_sDrawingObjectText(rDrawingObjectText)
4504 const OUString& rPropertyName,
const Any& )
4506 throw UnknownPropertyException(rPropertyName);
4512 throw UnknownPropertyException(rPropertyName);
4518 const OUString& ,
const Reference< XPropertyChangeListener > & )
4523 const OUString& ,
const Reference< XPropertyChangeListener > & )
4528 const OUString& ,
const Reference< XVetoableChangeListener > & )
4533 const OUString& ,
const Reference< XVetoableChangeListener > & )
4539 return "SwXDrawingObjectTarget";
4566 Reference<XInterface> xRet;
4608 #if OSL_DEBUG_LEVEL > 0
4609 default: OSL_FAIL(
"which table?");
4638 , m_aOldViewOptions( rViewOptions )
4659 const bool bContainsHiddenParagraphs = pFieldType && pFieldType->
HasWriterListeners();
4671 aRenderViewOptions.
SetBlank(
false );
4673 aRenderViewOptions.
SetTab(
false );
4679 if (bContainsHiddenChars)
4681 if (bContainsHiddenFields)
4683 if (bContainsHiddenParagraphs)
4686 if (bContainsPlaceHolders)
4693 if (bContainsFields)
4702 aRenderViewOptions.
SetPrinting( pPrtOptions !=
nullptr );
virtual VclPtr< vcl::Window > getDocWindow() override
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
virtual css::uno::Any SAL_CALL getByName(const OUString &Name) override
SfxViewFrame * GetViewFrame() const
Instances of SwFields and those derived from it occur 0 to n times.
void SetLineBreak(bool b)
static void UpdatePagesForPrintingWithPostItData(SwRenderData &rData, const SwPrintUIOptions &rOptions, sal_Int32 nDocPageCount)
sal_Int32 GetBottomSpace() const
bool setGraphicSelection(int nType, int nX, int nY, double fScaleX=1.0, double fScaleY=1.0)
void SetShowPlaceHolderFields(bool bSet)
css::uno::Reference< css::container::XNameAccess > mxXTextFieldMasters
rtl::Reference< SwXDrawPage > m_xDrawPage
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 * >())
IDocumentStatistics const & getIDocumentStatistics() const
SwViewShell * GetViewShell() const
virtual ~SwXOutlineTarget() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
const SwStartNode * FindHeaderStartNode() const
bool IsPaperFromSetup() const
const sal_Int32 m_nOutlineLevel
Represents the style of a paragraph.
static SvxAutoCorrCfg & Get()
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Marks a position in the document model.
std::map< OUString, OUString > StringMap
static bool HasValidData(const css::uno::Reference< css::datatransfer::XTransferable > &rTransferable)
const OUString & GetTOIAutoMarkURL() const
virtual OUString SAL_CALL getImplementationName() override
OUString m_sDrawingObjectText
bool HasReplaceAttributes() const
css::uno::Reference< css::container::XNameAccess > mxXTextSections
virtual sal_Bool SAL_CALL hasByName(const OUString &Name) override
static bool lcl_SeqHasProperty(const uno::Sequence< beans::PropertyValue > &rOptions, const char *pPropName)
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
constexpr auto toTwips(N number, Length from)
#define WID_DOC_WORD_COUNT
void SetZoom(sal_uInt16 n)
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const =0
uno::Reference< text::XFlatParagraphIterator > CreateFlatParagraphIterator(SwDoc &rDoc, sal_Int32 const nTextMarkupType, bool const bAutomatic)
#define LANGUAGE_ENGLISH_US
OUString getPageRectangles()
Implementation of lok::Document::getPartPageRectangles() for Writer.
const SwStartNode * FindFooterStartNode() const
virtual sal_Bool SAL_CALL attachResource(const OUString &aURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getFootnotes() override
OUString toISO8601(const css::util::DateTime &rDateTime)
SwDocShell * GetDocShell()
const SwRect & GetAnchorRect() const
virtual ~SwXLinkNameAccessWrapper() override
std::shared_ptr< SwContentControl > GetContentControl()
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLinks() override
static std::shared_ptr< ConfigurationChanges > create()
virtual void CalcLayout()
SwUnoCursor * FindAny(const css::uno::Reference< css::util::XSearchDescriptor > &xDesc, css::uno::Reference< css::text::XTextCursor > &xCursor, bool bAll, sal_Int32 &nResult, css::uno::Reference< css::uno::XInterface > const &xLastResult)
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getFootnoteSettings() override
bool HasSearchAttributes() const
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 void initializeForTiledRendering(const css::uno::Sequence< css::beans::PropertyValue > &rArguments) override
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
static void lcl_SavePrintUIOptionsToDocumentPrintData(SwDoc &rDoc, const SwPrintUIOptions &rPrintUIOptions, bool bIsPDFEXport)
void SetViewLayout(sal_uInt16 nColumns, bool bBookMode, bool bViewOnly=false)
constexpr SwTwips DOCUMENTBORDER
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
bool isTiledAnnotations()
virtual OUString SAL_CALL getImplementationName() override
#define WID_DOC_CHAR_COUNT
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL render(sal_Int32 nRenderer, const css::uno::Any &aSelection, const css::uno::Sequence< css::beans::PropertyValue > &xOptions) override
static bool lcl_GetBoolProperty(const uno::Sequence< beans::PropertyValue > &rOptions, const char *pPropName)
std::unique_ptr< sal_Int32[]> pData
sal_Int32 addInterface(const css::uno::Reference< ListenerT > &rxIFace)
SfxDispatcher * GetDispatcher()
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
void SetRedlineAuthor(const OUString &rAuthor)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
static void PaintAllChartsOnTile(VirtualDevice &rDevice, int nOutputWidth, int nOutputHeight, int nTilePosX, int nTilePosY, tools::Long nTileWidth, tools::Long nTileHeight, bool bNegativeX=false)
css::uno::Reference< css::container::XNameAccess > mxXBookmarks
virtual void resetSelection() override
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
sal_Int32 GetRightSpace() const
static VclPtr< OutputDevice > lcl_GetOutputDevice(const SwPrintUIOptions &rPrintUIOptions)
static bool IsPaste(const SwWrtShell &, const TransferableDataHelper &)
virtual void SetModified()=0
Must be called manually at changes of format.
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
::comphelper::OInterfaceContainerHelper4< css::util::XRefreshListener > m_RefreshListeners
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
const SwPosition * GetMark() const
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual void SAL_CALL connectController(const css::uno::Reference< css::frame::XController > &xController) override
void LogicInvalidate(const tools::Rectangle *pRectangle) override
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
SfxViewShell * GuessViewShell(bool &rbIsSwSrcView, const css::uno::Reference< css::frame::XController > &rController=css::uno::Reference< css::frame::XController >())