LibreOffice Module sw (master)  1
xmltexti.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
25 #include <com/sun/star/embed/EmbeddedObjectCreator.hpp>
26 #include <com/sun/star/embed/OOoEmbeddedObjectFactory.hpp>
27 #include <com/sun/star/embed/XEmbeddedObject.hpp>
28 #include <com/sun/star/embed/Aspects.hpp>
29 #include <com/sun/star/frame/XModel.hpp>
30 #include <com/sun/star/task/XInteractionHandler.hpp>
31 #include <o3tl/any.hxx>
32 #include <osl/diagnose.h>
33 #include <rtl/ustrbuf.hxx>
34 #include <sal/log.hxx>
35 #include <comphelper/classids.hxx>
36 #include <com/sun/star/lang/XUnoTunnel.hpp>
37 #include <xmloff/prstylei.hxx>
38 #include <xmloff/maptype.hxx>
39 #include <xmloff/xmlprmap.hxx>
40 #include <xmloff/txtprmap.hxx>
41 #include <xmloff/i18nmap.hxx>
42 #include <xmloff/xmlimppr.hxx>
43 #include <TextCursorHelper.hxx>
44 #include <unoframe.hxx>
45 #include <doc.hxx>
48 #include <fmtfsize.hxx>
49 #include <fmtanchr.hxx>
50 #include <fmtcntnt.hxx>
51 #include "xmlimp.hxx"
52 #include "xmltbli.hxx"
53 #include "xmltexti.hxx"
56 #include <SwAppletImpl.hxx>
57 #include <ndole.hxx>
58 #include <docsh.hxx>
59 #include <sfx2/docfile.hxx>
60 #include <vcl/svapp.hxx>
62 #include <svtools/embedhlp.hxx>
63 #include <svl/urihelper.hxx>
64 #include <sfx2/frmdescr.hxx>
65 #include <tools/globname.hxx>
66 
67 #include <algorithm>
68 #include <utility>
69 
70 using namespace ::com::sun::star;
71 using namespace ::com::sun::star::uno;
72 using namespace ::com::sun::star::lang;
73 using namespace ::com::sun::star::text;
74 using namespace ::com::sun::star::frame;
75 using namespace ::com::sun::star::beans;
76 using namespace xml::sax;
77 
78 const std::pair<OUString, SvGUID> aServiceMap[] = {
85 };
86 static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet,
87  sal_Int32 nHeight, sal_Int32 nWidth,
88  Size *pTwipSize = nullptr )
89 {
90  if( nWidth > 0 && nHeight > 0 )
91  {
92  nWidth = o3tl::toTwips(nWidth, o3tl::Length::mm100);
93  if( nWidth < MINFLY )
94  nWidth = MINFLY;
95  nHeight = o3tl::toTwips(nHeight, o3tl::Length::mm100);
96  if( nHeight < MINFLY )
97  nHeight = MINFLY;
98  rItemSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, nWidth, nHeight ) );
99  }
100 
101  SwFormatAnchor aAnchor( RndStdIds::FLY_AT_CHAR );
102  rItemSet.Put( aAnchor );
103 
104  if( pTwipSize )
105  {
106  pTwipSize->setWidth( nWidth );
107  pTwipSize->setHeight( nHeight);
108  }
109 }
110 
111 static void lcl_setObjectVisualArea( const uno::Reference< embed::XEmbeddedObject >& xObj,
112  sal_Int64 nAspect,
113  const Size& aVisSize,
114  const MapUnit& aUnit )
115 {
116  if( !(xObj.is() && nAspect != embed::Aspects::MSOLE_ICON) )
117  return;
118 
119  // convert the visual area to the objects units
120  MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
121  Size aObjVisSize = OutputDevice::LogicToLogic(aVisSize, MapMode(aUnit), MapMode(aObjUnit));
122  awt::Size aSz;
123  aSz.Width = aObjVisSize.Width();
124  aSz.Height = aObjVisSize.Height();
125 
126  try
127  {
128  xObj->setVisualAreaSize( nAspect, aSz );
129  }
130  catch( uno::Exception& )
131  {
132  OSL_FAIL( "Couldn't set visual area of the object!" );
133  }
134 }
135 
137  const uno::Reference < XModel>& rModel,
138  SvXMLImport& rImport,
139  const uno::Reference<XPropertySet> & rInfoSet,
140  bool bInsertM, bool bStylesOnlyM,
141  bool bBlockM, bool bOrganizerM ) :
142  XMLTextImportHelper( rModel, rImport, bInsertM, bStylesOnlyM, true/*bProgress*/,
143  bBlockM, bOrganizerM ),
144  m_pRedlineHelper( nullptr )
145 {
146  uno::Reference<XPropertySet> xDocPropSet( rModel, UNO_QUERY );
148  bInsertM || bBlockM, xDocPropSet, rInfoSet );
149 }
150 
152 {
153  // the redline helper destructor sets properties on the document
154  // and may throw an exception while doing so... catch this
155  try
156  {
157  delete m_pRedlineHelper;
158  }
159  catch ( const RuntimeException& )
160  {
161  // ignore
162  }
163 }
164 
166  SvXMLImport& rImport,
167  sal_Int32 /*nElement*/,
168  const uno::Reference< XFastAttributeList > & xAttrList )
169 {
170  return new SwXMLTableContext( static_cast<SwXMLImport&>(rImport), xAttrList );
171 }
172 
174 {
175  uno::Reference<XUnoTunnel> xCursorTunnel(
176  const_cast<SwXMLTextImportHelper *>(this)->GetCursor(), UNO_QUERY );
177  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
178  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
179  SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing");
180  SwDoc *pDoc = pTextCursor ? pTextCursor->GetDoc() : nullptr;
181 
182  return pDoc && pDoc->IsInHeaderFooter( pTextCursor->GetPaM()->GetPoint()->nNode );
183 }
184 
185 static SwOLENode *lcl_GetOLENode( const SwFrameFormat *pFrameFormat )
186 {
187  SwOLENode *pOLENd = nullptr;
188  if( pFrameFormat )
189  {
190  const SwFormatContent& rContent = pFrameFormat->GetContent();
191  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
192  pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode();
193  }
194  OSL_ENSURE( pOLENd, "Where is the OLE node" );
195  return pOLENd;
196 }
197 
198 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
199  SvXMLImport& rImport,
200  const OUString& rHRef,
201  const OUString& rStyleName,
202  const OUString& rTableName,
203  sal_Int32 nWidth, sal_Int32 nHeight )
204 {
205  // this method will modify the document directly -> lock SolarMutex
206  SolarMutexGuard aGuard;
207 
208  uno::Reference < XPropertySet > xPropSet;
209 
210  sal_Int32 nPos = rHRef.indexOf( ':' );
211  if( -1 == nPos )
212  return xPropSet;
213 
214  OUString aObjName( rHRef.copy( nPos+1) );
215 
216  if( aObjName.isEmpty() )
217  return xPropSet;
218 
219  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
220  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
221  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
222  SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing");
223  SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport );
224 
226  Size aTwipSize( 0, 0 );
227  tools::Rectangle aVisArea( 0, 0, nWidth, nHeight );
228  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
229  &aTwipSize );
230 
231  SwFrameFormat *pFrameFormat = nullptr;
232  SwOLENode *pOLENd = nullptr;
233  if( rHRef.startsWith("vnd.sun.star.ServiceName:") )
234  {
235  bool bInsert = false;
236  SvGlobalName aClassName;
237  for (const auto& [sFilterService, rCLASSID] : aServiceMap)
238  {
239  if (aObjName == sFilterService)
240  {
241  aClassName = SvGlobalName(rCLASSID);
242  bInsert = true;
243  break;
244  }
245  }
246 
247  if( bInsert )
248  {
249  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
250  try
251  {
252  // create object with desired ClassId
253  uno::Sequence < sal_Int8 > aClass( aClassName.GetByteSequence() );
254  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
255  uno::Sequence<beans::PropertyValue> aObjArgs( comphelper::InitPropertySequence({
256  { "DefaultParentBaseURL", Any(GetXMLImport().GetBaseURL()) }
257  }));
258  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
259  aClass, OUString(), xStorage, "DummyName", aObjArgs), uno::UNO_QUERY );
260  if ( xObj.is() )
261  {
262  //TODO/LATER: is it enough to only set the VisAreaSize?
263  lcl_setObjectVisualArea( xObj, embed::Aspects::MSOLE_CONTENT, aTwipSize, MapUnit::MapTwip );
264  }
265 
266  if( pTextCursor )
267  {
268  pFrameFormat = pDoc->getIDocumentContentOperations().InsertEmbObject(
269  *pTextCursor->GetPaM(),
270  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
271  &aItemSet);
272  pOLENd = lcl_GetOLENode( pFrameFormat );
273  }
274 
275  if( pOLENd )
276  aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
277  }
278  catch ( uno::Exception& )
279  {
280  }
281  }
282  }
283  else
284  {
285  // check whether an object with this name already exists in the document
286  OUString aName;
288  for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
289  {
290  SwOLENode* pExistingOLENd = pNd->GetOLENode();
291  if( pExistingOLENd )
292  {
293  OUString aExistingName = pExistingOLENd->GetOLEObj().GetCurrentPersistName();
294  if ( aExistingName == aObjName )
295  {
296  OSL_FAIL( "The document contains duplicate object references, means it is partially broken, please let developers know how this document was generated!" );
297 
298  OUString aTmpName = pDoc->GetPersist()->GetEmbeddedObjectContainer().CreateUniqueObjectName();
299  try
300  {
301  pDoc->GetPersist()->GetStorage()->copyElementTo( aObjName,
302  pDoc->GetPersist()->GetStorage(),
303  aTmpName );
304  aName = aTmpName;
305  }
306  catch ( uno::Exception& )
307  {
308  OSL_FAIL( "Couldn't create a copy of the object!" );
309  }
310 
311  break;
312  }
313  }
314  }
315 
316  if ( aName.isEmpty() )
317  aName = aObjName;
318 
319  // the correct aspect will be set later
320  // TODO/LATER: Actually it should be set here
321  if( pTextCursor )
322  {
323  pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( *pTextCursor->GetPaM(), aName, embed::Aspects::MSOLE_CONTENT, &aItemSet, nullptr );
324  pOLENd = lcl_GetOLENode( pFrameFormat );
325  }
326  aObjName = aName;
327  }
328 
329  if( !pFrameFormat )
330  return xPropSet;
331 
332  if( IsInsertMode() )
333  {
334  if( !pOLENd )
335  pOLENd = lcl_GetOLENode( pFrameFormat );
336  if( pOLENd )
337  pOLENd->SetOLESizeInvalid( true );
338  }
339 
341  *pDoc, pFrameFormat), uno::UNO_QUERY);
343  {
344  // req for z-order
345  SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat));
346  }
347  if( !rTableName.isEmpty() )
348  {
349  const SwFormatContent& rContent = pFrameFormat->GetContent();
350  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
351  SwOLENode *pOLENode = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode();
352  OSL_ENSURE( pOLENode, "Where is the OLE node" );
353 
354  OUStringBuffer aBuffer( rTableName.getLength() );
355  bool bQuoted = false;
356  bool bEscape = false;
357  bool bError = false;
358  for( sal_Int32 i=0; i < rTableName.getLength(); i++ )
359  {
360  bool bEndOfNameFound = false;
361  sal_Unicode c = rTableName[i];
362  switch( c )
363  {
364  case '\'':
365  if( bEscape )
366  {
367  aBuffer.append( c );
368  bEscape = false;
369  }
370  else if( bQuoted )
371  {
372  bEndOfNameFound = true;
373  }
374  else if( 0 == i )
375  {
376  bQuoted = true;
377  }
378  else
379  {
380  bError = true;
381  }
382  break;
383  case '\\':
384  if( bEscape )
385  {
386  aBuffer.append( c );
387  bEscape = false;
388  }
389  else
390  {
391  bEscape = true;
392  }
393  break;
394  case ' ':
395  case '.':
396  if( !bQuoted )
397  {
398  bEndOfNameFound = true;
399  }
400  else
401  {
402  aBuffer.append( c );
403  bEscape = false;
404  }
405  break;
406  default:
407  {
408  aBuffer.append( c );
409  bEscape = false;
410  }
411  break;
412  }
413  if( bError || bEndOfNameFound )
414  break;
415  }
416  if( !bError )
417  {
418  OUString sTableName( aBuffer.makeStringAndClear() );
419  pOLENode->SetChartTableName( GetRenameMap().Get( XML_TEXT_RENAME_TYPE_TABLE, sTableName ) );
420  }
421  }
422 
423  sal_Int64 nDrawAspect = 0;
424  const XMLPropStyleContext *pStyle = nullptr;
425  bool bHasSizeProps = false;
426  if( !rStyleName.isEmpty() )
427  {
428  pStyle = FindAutoFrameStyle( rStyleName );
429  if( pStyle )
430  {
432  pStyle->GetStyles()
433  ->GetImportPropertyMapper(pStyle->GetFamily());
434  OSL_ENSURE( xImpPrMap.is(), "Where is the import prop mapper?" );
435  if( xImpPrMap.is() )
436  {
438  xImpPrMap->getPropertySetMapper();
439 
440  sal_Int32 nCount = pStyle->GetProperties().size();
441  for( sal_Int32 i=0; i < nCount; i++ )
442  {
443  const XMLPropertyState& rProp = pStyle->GetProperties()[i];
444  sal_Int32 nIdx = rProp.mnIndex;
445  if( -1 == nIdx )
446  continue;
447 
448  switch( rPropMapper->GetEntryContextId(nIdx) )
449  {
451  {
452  sal_Int32 nVal = 0;
453  rProp.maValue >>= nVal;
454  aVisArea.SetPosX( nVal );
455  }
456  break;
458  {
459  sal_Int32 nVal = 0;
460  rProp.maValue >>= nVal;
461  aVisArea.SetPosY( nVal );
462  }
463  break;
465  {
466  sal_Int32 nVal = 0;
467  rProp.maValue >>= nVal;
468  aVisArea.setWidth( nVal );
469  bHasSizeProps = true;
470  }
471  break;
473  {
474  sal_Int32 nVal = 0;
475  rProp.maValue >>= nVal;
476  aVisArea.setHeight( nVal );
477  bHasSizeProps = true;
478  }
479  break;
480  case CTF_OLE_DRAW_ASPECT:
481  {
482  rProp.maValue >>= nDrawAspect;
483 
484  if ( !nDrawAspect )
485  nDrawAspect = embed::Aspects::MSOLE_CONTENT;
486 
487  if ( pOLENd )
488  pOLENd->GetOLEObj().GetObject().SetViewAspect( nDrawAspect );
489  }
490  break;
491  }
492  }
493  }
494  }
495  }
496 
497  if ( bHasSizeProps )
498  {
499  uno::Reference < embed::XEmbeddedObject > xObj =
501  if( xObj.is() )
502  lcl_setObjectVisualArea( xObj, ( nDrawAspect ? nDrawAspect : embed::Aspects::MSOLE_CONTENT ),
503  aVisArea.GetSize(), MapUnit::Map100thMM );
504  }
505 
506  return xPropSet;
507 }
508 
509 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
510  SvXMLImport& rImport,
511  const OUString& rHRef,
512  const OUString& /*rStyleName*/,
513  const OUString& /*rTableName*/,
514  sal_Int32 nWidth, sal_Int32 nHeight )
515 {
516  // this method will modify the document directly -> lock SolarMutex
517  SolarMutexGuard aGuard;
518 
519  uno::Reference < XPropertySet > xPropSet;
520 
521  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
522  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
523  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
524  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
525  SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport );
526 
528  Size aTwipSize( 0, 0 );
529  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
530  &aTwipSize );
531 
532  // We'll need a (valid) URL. If we don't have do not insert the link and return early.
533  // Copy URL into URL object on the way.
534  INetURLObject aURLObj;
535  bool bValidURL = !rHRef.isEmpty() &&
537  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
538  if( !bValidURL )
539  return xPropSet;
540 
541  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
542  try
543  {
544  // create object with desired ClassId
545  uno::Reference < embed::XEmbeddedObjectCreator > xFactory =
546  embed::OOoEmbeddedObjectFactory::create(::comphelper::getProcessComponentContext());
547 
548  uno::Sequence< beans::PropertyValue > aMediaDescriptor{ comphelper::makePropertyValue(
550 
551  if (SfxMedium* pMedium = pDoc->GetDocShell() ? pDoc->GetDocShell()->GetMedium() : nullptr)
552  {
553  uno::Reference< task::XInteractionHandler > xInteraction = pMedium->GetInteractionHandler();
554  if ( xInteraction.is() )
555  {
556  aMediaDescriptor.realloc( 2 );
557  auto pMediaDescriptor = aMediaDescriptor.getArray();
558  pMediaDescriptor[1].Name = "InteractionHandler";
559  pMediaDescriptor[1].Value <<= xInteraction;
560  }
561 
562  const auto nLen = aMediaDescriptor.getLength() + 1;
563  aMediaDescriptor.realloc(nLen);
564  auto pMediaDescriptor = aMediaDescriptor.getArray();
565  pMediaDescriptor[nLen - 1].Name = "Referer";
566  pMediaDescriptor[nLen - 1].Value <<= pMedium->GetName();
567  }
568 
569  uno::Reference < embed::XEmbeddedObject > xObj(
570  xFactory->createInstanceLink(
571  xStorage, "DummyName", aMediaDescriptor, uno::Sequence< beans::PropertyValue >() ),
572  uno::UNO_QUERY_THROW );
573 
574  {
575  SwFrameFormat *const pFrameFormat =
577  *pTextCursor->GetPaM(),
578  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
579  &aItemSet );
580 
581  // TODO/LATER: in future may need a way to set replacement image url to the link ( may be even to the object ), needs oasis cws???
582 
584  *pDoc, pFrameFormat), uno::UNO_QUERY);
586  {
588  static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order
589  }
590  }
591  }
592  catch ( uno::Exception& )
593  {
594  }
595 
596  // TODO/LATER: should the rStyleName and rTableName be handled as for usual embedded object?
597 
598  return xPropSet;
599 }
600 
601 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet(
602  const OUString &rName,
603  const OUString &rCode,
604  bool bMayScript,
605  const OUString& rHRef,
606  sal_Int32 nWidth, sal_Int32 nHeight )
607 {
608  // this method will modify the document directly -> lock SolarMutex
609  SolarMutexGuard aGuard;
610 
611  uno::Reference < XPropertySet > xPropSet;
612  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
613  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
614  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
615  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
616  SwDoc *pDoc = pTextCursor->GetDoc();
617 
619  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
620 
621  SwApplet_Impl aAppletImpl ( aItemSet );
622 
623  OUString sCodeBase;
624  if( !rHRef.isEmpty() )
625  sCodeBase = GetXMLImport().GetAbsoluteReference( rHRef );
626 
627  aAppletImpl.CreateApplet ( rCode, rName, bMayScript, sCodeBase, GetXMLImport().GetDocumentBase() );
628 
629  // set the size of the applet
630  lcl_setObjectVisualArea( aAppletImpl.GetApplet(),
631  embed::Aspects::MSOLE_CONTENT,
632  Size( nWidth, nHeight ),
633  MapUnit::Map100thMM );
634 
635  SwFrameFormat *const pFrameFormat =
636  pDoc->getIDocumentContentOperations().InsertEmbObject( *pTextCursor->GetPaM(),
637  ::svt::EmbeddedObjectRef(aAppletImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT),
638  &aAppletImpl.GetItemSet());
640  *pDoc, pFrameFormat), uno::UNO_QUERY);
642  {
643  // req for z-order
644  SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat));
645  }
646 
647  return xPropSet;
648 }
649 
650 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin(
651  const OUString &rMimeType,
652  const OUString& rHRef,
653  sal_Int32 nWidth, sal_Int32 nHeight )
654 {
655  uno::Reference < XPropertySet > xPropSet;
656  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
657  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
658  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
659  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
660  SwDoc *pDoc = pTextCursor->GetDoc();
661 
663  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
664 
665  // We'll need a (valid) URL, or we need a MIME type. If we don't have
666  // either, do not insert plugin and return early. Copy URL into URL object
667  // on the way.
668  INetURLObject aURLObj;
669 
670  bool bValidURL = !rHRef.isEmpty() &&
671  aURLObj.SetURL( URIHelper::SmartRel2Abs( INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
672  bool bValidMimeType = !rMimeType.isEmpty();
673  if( !bValidURL && !bValidMimeType )
674  return xPropSet;
675 
676  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
677  try
678  {
679  // create object with desired ClassId
680  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence() );
681  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
682  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
683  aClass, OUString(), xStorage, "DummyName",
684  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
685 
686  // set size to the object
688  embed::Aspects::MSOLE_CONTENT,
689  Size( nWidth, nHeight ),
690  MapUnit::Map100thMM );
691 
693  {
694  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
695  if ( xSet.is() )
696  {
697  if( bValidURL )
698  xSet->setPropertyValue("PluginURL",
700  if( bValidMimeType )
701  xSet->setPropertyValue("PluginMimeType",
702  Any( rMimeType ) );
703  }
704 
705  SwFrameFormat *const pFrameFormat =
707  *pTextCursor->GetPaM(),
708  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
709  &aItemSet);
711  *pDoc, pFrameFormat), uno::UNO_QUERY);
713  {
715  static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order
716  }
717  }
718  }
719  catch ( uno::Exception& )
720  {
721  }
722 
723  return xPropSet;
724 }
726  const OUString& rName,
727  const OUString& rHRef,
728  const OUString& rStyleName,
729  sal_Int32 nWidth, sal_Int32 nHeight )
730 {
731  // this method will modify the document directly -> lock SolarMutex
732  SolarMutexGuard aGuard;
733 
734  uno::Reference < XPropertySet > xPropSet;
735  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
736  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
737  OTextCursorHelper* pTextCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xCursorTunnel);
738  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
739  SwDoc *pDoc = pTextCursor->GetDoc();
740 
742  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
743 
744  ScrollingMode eScrollMode = ScrollingMode::Auto;
745  bool bHasBorder = false;
746  bool bIsBorderSet = false;
747  Size aMargin( SIZE_NOT_SET, SIZE_NOT_SET );
748  const XMLPropStyleContext *pStyle = nullptr;
749  if( !rStyleName.isEmpty() )
750  {
751  pStyle = FindAutoFrameStyle( rStyleName );
752  if( pStyle )
753  {
755  pStyle->GetStyles()
756  ->GetImportPropertyMapper(pStyle->GetFamily());
757  OSL_ENSURE( xImpPrMap.is(), "Where is the import prop mapper?" );
758  if( xImpPrMap.is() )
759  {
761  xImpPrMap->getPropertySetMapper();
762 
763  sal_Int32 nCount = pStyle->GetProperties().size();
764  for( sal_Int32 i=0; i < nCount; i++ )
765  {
766  const XMLPropertyState& rProp = pStyle->GetProperties()[i];
767  sal_Int32 nIdx = rProp.mnIndex;
768  if( -1 == nIdx )
769  continue;
770 
771  switch( rPropMapper->GetEntryContextId(nIdx) )
772  {
774  {
775  bool bYes = *o3tl::doAccess<bool>(rProp.maValue);
776  eScrollMode = bYes ? ScrollingMode::Yes : ScrollingMode::No;
777  }
778  break;
780  {
781  bHasBorder = *o3tl::doAccess<bool>(rProp.maValue);
782  bIsBorderSet = true;
783  }
784  break;
786  {
787  sal_Int32 nVal = SIZE_NOT_SET;
788  rProp.maValue >>= nVal;
789  aMargin.setWidth( nVal );
790  }
791  break;
793  {
794  sal_Int32 nVal = SIZE_NOT_SET;
795  rProp.maValue >>= nVal;
796  aMargin.setHeight( nVal );
797  }
798  break;
799  }
800  }
801  }
802  }
803  }
804 
805  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
806  try
807  {
808  // create object with desired ClassId
809  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence() );
810  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
811  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
812  aClass, OUString(), xStorage, "DummyName",
813  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
814 
815  // set size to the object
817  embed::Aspects::MSOLE_CONTENT,
818  Size( nWidth, nHeight ),
819  MapUnit::Map100thMM );
820 
822  {
823  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
824  if ( xSet.is() )
825  {
826  xSet->setPropertyValue("FrameURL",
828  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) ) );
829 
830  xSet->setPropertyValue("FrameName",
831  Any( rName ) );
832 
833  if ( eScrollMode == ScrollingMode::Auto )
834  xSet->setPropertyValue("FrameIsAutoScroll",
835  Any( true ) );
836  else
837  xSet->setPropertyValue("FrameIsScrollingMode",
838  Any( eScrollMode == ScrollingMode::Yes ) );
839 
840  if ( bIsBorderSet )
841  xSet->setPropertyValue("FrameIsBorder",
842  Any( bHasBorder ) );
843  else
844  xSet->setPropertyValue("FrameIsAutoBorder",
845  Any( true ) );
846 
847  xSet->setPropertyValue("FrameMarginWidth",
848  Any( sal_Int32( aMargin.Width() ) ) );
849 
850  xSet->setPropertyValue("FrameMarginHeight",
851  Any( sal_Int32( aMargin.Height() ) ) );
852  }
853 
854  SwFrameFormat *const pFrameFormat =
856  *pTextCursor->GetPaM(),
857  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
858  &aItemSet);
860  *pDoc, pFrameFormat), uno::UNO_QUERY);
862  {
863  // req for z-order
865  static_cast<SwFlyFrameFormat*>(pFrameFormat));
866  }
867  }
868  }
869  catch ( uno::Exception& )
870  {
871  }
872 
873  return xPropSet;
874 }
875 
877  const uno::Reference < XPropertySet > &rPropSet,
878  std::map < const OUString, OUString > &rParamMap)
879 {
880  // this method will modify the document directly -> lock SolarMutex
881  SolarMutexGuard aGuard;
882 
883  uno::Reference<XUnoTunnel> xCursorTunnel( rPropSet, UNO_QUERY );
884  assert(xCursorTunnel.is() && "missing XUnoTunnel for embedded");
885  SwXFrame* pFrame = comphelper::getFromUnoTunnel<SwXFrame>(xCursorTunnel);
886  OSL_ENSURE( pFrame, "SwXFrame missing" );
887  SwFrameFormat *pFrameFormat = pFrame->GetFrameFormat();
888  const SwFormatContent& rContent = pFrameFormat->GetContent();
889  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
890  SwOLENode *pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTextNode()->GetOLENode();
891  SwOLEObj& rOLEObj = pOLENd->GetOLEObj();
892 
893  uno::Reference < embed::XEmbeddedObject > xEmbObj( rOLEObj.GetOleRef() );
894  if ( !svt::EmbeddedObjectRef::TryRunningState( xEmbObj ) )
895  return;
896 
897  uno::Reference < beans::XPropertySet > xSet( xEmbObj->getComponent(), uno::UNO_QUERY );
898  if ( !xSet.is() )
899  return;
900 
901  const sal_Int32 nCount = rParamMap.size();
902  uno::Sequence< beans::PropertyValue > aCommandSequence( nCount );
903 
904  std::transform(rParamMap.begin(), rParamMap.end(), aCommandSequence.getArray(),
905  [](const auto& rParam)
906  {
907  return beans::PropertyValue(/* Name */ rParam.first,
908  /* Handle */ -1,
909  /* Value */ uno::Any(rParam.second),
910  /* State */ beans::PropertyState_DIRECT_VALUE);
911  });
912 
913  // unfortunately the names of the properties are depending on the object
914  OUString aParaName("AppletCommands");
915  try
916  {
917  xSet->setPropertyValue( aParaName, Any( aCommandSequence ) );
918  }
919  catch ( uno::Exception& )
920  {
921  aParaName = "PluginCommands";
922  try
923  {
924  xSet->setPropertyValue( aParaName, Any( aCommandSequence ) );
925  }
926  catch ( uno::Exception& )
927  {
928  }
929  }
930 }
931 
932 // redlining helper methods
933 // (override to provide the real implementation)
935  const OUString& rType,
936  const OUString& rId,
937  const OUString& rAuthor,
938  const OUString& rComment,
939  const util::DateTime& rDateTime,
940  bool bMergeLastPara)
941 {
942  // create redline helper on demand
943  OSL_ENSURE(nullptr != m_pRedlineHelper, "helper should have been created in constructor");
944  if (nullptr != m_pRedlineHelper)
945  m_pRedlineHelper->Add(rType, rId, rAuthor, rComment, rDateTime,
946  bMergeLastPara);
947 }
948 
949 uno::Reference<XTextCursor> SwXMLTextImportHelper::RedlineCreateText(
950  uno::Reference<XTextCursor> & rOldCursor,
951  const OUString& rId)
952 {
953  uno::Reference<XTextCursor> xRet;
954 
955  if (nullptr != m_pRedlineHelper)
956  {
957  xRet = m_pRedlineHelper->CreateRedlineTextSection(rOldCursor, rId);
958  }
959 
960  return xRet;
961 }
962 
964  const OUString& rId,
965  bool bStart,
966  bool bIsOutsideOfParagraph)
967 {
968  if (nullptr != m_pRedlineHelper) {
969  uno::Reference<XTextRange> xTextRange( GetCursor()->getStart() );
970  m_pRedlineHelper->SetCursor(rId, bStart, xTextRange,
971  bIsOutsideOfParagraph);
972  }
973  // else: ignore redline (wasn't added before, else we'd have a helper)
974 }
975 
977 {
978  OUString rId = GetOpenRedlineId();
979  if ((nullptr != m_pRedlineHelper) && !rId.isEmpty())
980  {
983  }
984  // else: ignore redline (wasn't added before, or no open redline ID
985 }
986 
987 void SwXMLTextImportHelper::SetShowChanges( bool bShowChanges )
988 {
989  if ( nullptr != m_pRedlineHelper )
990  m_pRedlineHelper->SetShowChanges( bShowChanges );
991 }
992 
993 void SwXMLTextImportHelper::SetRecordChanges( bool bRecordChanges )
994 {
995  if ( nullptr != m_pRedlineHelper )
996  m_pRedlineHelper->SetRecordChanges( bRecordChanges );
997 }
998 
1000  const Sequence<sal_Int8> & rKey )
1001 {
1002  if ( nullptr != m_pRedlineHelper )
1004 }
1005 
1006 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const css::uno::Reference< css::embed::XEmbeddedObject > & GetApplet() const
XmlStyleFamily GetFamily() const
virtual css::uno::Reference< css::text::XTextCursor > RedlineCreateText(css::uno::Reference< css::text::XTextCursor > &rOldCursor, const OUString &rId) override
merge last paragraph
Definition: xmltexti.cxx:949
css::uno::Reference< css::text::XTextCursor > & GetCursor()
virtual void SetRecordChanges(bool bRecordChanges) override
Definition: xmltexti.cxx:993
constexpr auto toTwips(N number, Length from)
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:164
void setWidth(tools::Long nWidth)
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:115
SwDocShell * GetDocShell()
Definition: doc.hxx:1351
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
const ::std::vector< XMLPropertyState > & GetProperties() const
#define SO3_IFRAME_CLASSID
#define MINFLY
Definition: swtypes.hxx:61
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
virtual void RedlineSetCursor(const OUString &rId, bool bStart, bool bIsOutsideOfParagraph) override
ID used to RedlineAdd() call.
Definition: xmltexti.cxx:963
#define CTF_FRAME_MARGIN_HORI
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:939
Definition: doc.hxx:187
#define CTF_OLE_VIS_AREA_TOP
sal_Int32 mnIndex
css::uno::Sequence< sal_Int8 > GetByteSequence() const
#define CTF_OLE_VIS_AREA_WIDTH
#define CTF_OLE_VIS_AREA_LEFT
#define SO3_SW_CLASSID
SfxItemSet & GetItemSet()
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
#define CTF_FRAME_DISPLAY_SCROLLBAR
SvI18NMap & GetRenameMap()
#define SO3_SM_CLASSID
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
Definition: doclay.cxx:1550
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertOOoLink(SvXMLImport &rImport, const OUString &rHRef, const OUString &rStyleName, const OUString &rTableName, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:509
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertFloatingFrame(const OUString &rName, const OUString &rHRef, const OUString &rStyleName, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:725
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
css::uno::Reference< css::embed::XStorage > const & GetStorage()
#define SO3_SIMPRESS_CLASSID
constexpr tools::Long Width() const
void SetRecordChanges(bool bRecordChanges)
sal_uInt16 sal_Unicode
ScrollingMode
virtual void RedlineAdd(const OUString &rType, const OUString &rId, const OUString &rAuthor, const OUString &rComment, const css::util::DateTime &rDateTime, bool bMergeLastPara) override
Definition: xmltexti.cxx:934
void SetProtectionKey(const css::uno::Sequence< sal_Int8 > &rKey)
constexpr OUStringLiteral XML_IMPORT_FILTER_CHART
void SetShowChanges(bool bShowChanges)
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:990
void CreateApplet(const OUString &rCode, const OUString &rName, bool bMayScript, const OUString &rCodeBase, std::u16string_view rBaseURL)
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertApplet(const OUString &rName, const OUString &rCode, bool bMayScript, const OUString &rHRef, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:601
int nCount
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:152
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
const SvXMLStylesContext * GetStyles() const
virtual SwFlyFrameFormat * InsertOLE(const SwPaM &rRg, const OUString &rObjName, sal_Int64 nAspect, const SfxItemSet *pFlyAttrSet, const SfxItemSet *pGrfAttrSet)=0
const OUString & GetCurrentPersistName() const
Definition: ndole.hxx:71
css::uno::Reference< css::text::XTextCursor > CreateRedlineTextSection(css::uno::Reference< css::text::XTextCursor > const &xOldCursor, const OUString &rId)
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertPlugin(const OUString &rMimeType, const OUString &rHRef, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:650
virtual void SetShowChanges(bool bShowChanges) override
Definition: xmltexti.cxx:987
#define XML_TEXT_RENAME_TYPE_TABLE
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertOLEObject(SvXMLImport &rImport, const OUString &rHRef, const OUString &rStyleName, const OUString &rTableName, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:198
static css::uno::Reference< css::embed::XStorage > GetTemporaryStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Style of a layout element.
Definition: frmfmt.hxx:59
constexpr OUStringLiteral XML_IMPORT_FILTER_DRAW
int i
SvXMLImport & GetXMLImport()
constexpr OUStringLiteral XML_IMPORT_FILTER_CALC
FlyAnchors.
Definition: fmtanchr.hxx:34
virtual void endAppletOrPlugin(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, std::map< const OUString, OUString > &rParamMap) override
Definition: xmltexti.cxx:876
static SdrObject * GetOrCreateSdrObject(SwFlyFrameFormat &rFormat)
Definition: unoframe.cxx:1347
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
SwXMLTextImportHelper(const css::uno::Reference< css::frame::XModel > &rModel, SvXMLImport &rImport, const css::uno::Reference< css::beans::XPropertySet > &rInfoSet, bool bInsertM, bool bStylesOnlyM, bool bBlockM, bool bOrganizerM)
Definition: xmltexti.cxx:136
virtual bool IsInHeaderFooter() const override
Definition: xmltexti.cxx:173
void SetPosY(tools::Long y)
Marks a node in the document model.
Definition: ndindex.hxx:30
virtual ~SwXMLTextImportHelper() override
Definition: xmltexti.cxx:151
bool IsInsertMode() const
#define CTF_FRAME_DISPLAY_BORDER
static SwOLENode * lcl_GetOLENode(const SwFrameFormat *pFrameFormat)
Definition: xmltexti.cxx:185
static void lcl_setObjectVisualArea(const uno::Reference< embed::XEmbeddedObject > &xObj, sal_Int64 nAspect, const Size &aVisSize, const MapUnit &aUnit)
Definition: xmltexti.cxx:111
#define CTF_FRAME_MARGIN_VERT
Frame cannot be moved in Var-direction.
#define CTF_OLE_DRAW_ASPECT
virtual SwFlyFrameFormat * InsertEmbObject(const SwPaM &rRg, const svt::EmbeddedObjectRef &xObj, SfxItemSet *pFlyAttrSet)=0
Insert OLE-objects.
virtual void SetChangesProtectionKey(const css::uno::Sequence< sal_Int8 > &rKey) override
Definition: xmltexti.cxx:999
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
void SetCursor(const OUString &rId, bool bStart, css::uno::Reference< css::text::XTextRange > const &rRange, bool bIsOutsideOfParagraph)
#define SO3_SC_CLASSID
bool SetURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
css::uno::Reference< css::embed::XEmbeddedObject > GetEmbeddedObject(const OUString &, OUString const *pBaseURL=nullptr)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
void SetChartTableName(const OUString &rNm)
Definition: ndole.hxx:156
const std::pair< OUString, SvGUID > aServiceMap[]
Definition: xmltexti.cxx:78
void AdjustStartNodeCursor(const OUString &rId)
Adjust the start (end) position for a redline that begins in a start node.
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
XMLRedlineImportHelper * m_pRedlineHelper
Definition: xmltexti.hxx:29
constexpr Size GetSize() const
comphelper::EmbeddedObjectContainer & GetEmbeddedObjectContainer() const
std::unique_ptr< char[]> aBuffer
void SetViewAspect(sal_Int64 nAspect)
css::uno::Any maValue
static void lcl_putHeightAndWidth(SfxItemSet &rItemSet, sal_Int32 nHeight, sal_Int32 nWidth, Size *pTwipSize=nullptr)
Definition: xmltexti.cxx:86
#define CTF_OLE_VIS_AREA_HEIGHT
OUString GetAbsoluteReference(const OUString &rValue) const
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
#define SAL_WARN_IF(condition, area, stream)
constexpr tools::Long Height() const
const SwNodes & GetNodes() const
Definition: ndindex.hxx:156
void setWidth(tools::Long n)
XMLPropStyleContext * FindAutoFrameStyle(const OUString &rName) const
OUString aName
#define SO3_SCH_CLASSID
void Add(std::u16string_view rType, const OUString &rId, const OUString &rAuthor, const OUString &rComment, const css::util::DateTime &rDateTime, bool bMergeLastParagraph)
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:639
Reference< XComponentContext > getProcessComponentContext()
virtual SvXMLImportContext * CreateTableChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmltexti.cxx:165
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
void SetOLESizeInvalid(bool b)
Definition: ndole.hxx:137
virtual void RedlineAdjustStartNodeCursor() override
Definition: xmltexti.cxx:976
void setHeight(tools::Long nHeight)
MapUnit
Reference< XSingleServiceFactory > xFactory
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
void SetPosX(tools::Long x)
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
static css::uno::Reference< css::text::XTextContent > CreateXTextEmbeddedObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3508
constexpr OUStringLiteral XML_IMPORT_FILTER_MATH
SwDoc * GetDocFromXMLImport(SvXMLImport const &)
Definition: xmlimp.cxx:1621
const SwGrfFormatColl * GetDfltGrfFormatColl() const
Definition: doc.hxx:803
#define SO3_PLUGIN_CLASSID
#define SO3_SDRAW_CLASSID
#define SIZE_NOT_SET
void setHeight(tools::Long n)
constexpr OUStringLiteral XML_IMPORT_FILTER_WRITER
sal_uInt16 nPos
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1318
OUString const & GetOpenRedlineId() const
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
constexpr OUStringLiteral XML_IMPORT_FILTER_IMPRESS
SfxMedium * GetMedium() const