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 
23 #include <com/sun/star/embed/EmbeddedObjectCreator.hpp>
24 #include <com/sun/star/embed/OOoEmbeddedObjectFactory.hpp>
25 #include <com/sun/star/embed/XEmbeddedObject.hpp>
26 #include <com/sun/star/embed/Aspects.hpp>
27 #include <com/sun/star/frame/XModel.hpp>
28 #include <com/sun/star/task/XInteractionHandler.hpp>
29 #include <o3tl/any.hxx>
30 #include <rtl/ustrbuf.hxx>
31 #include <sal/log.hxx>
32 #include <comphelper/classids.hxx>
33 #include <com/sun/star/lang/XUnoTunnel.hpp>
34 #include <xmloff/prstylei.hxx>
35 #include <xmloff/maptype.hxx>
36 #include <xmloff/xmlprmap.hxx>
37 #include <xmloff/txtprmap.hxx>
38 #include <xmloff/i18nmap.hxx>
39 #include <xmloff/xmlimppr.hxx>
40 #include <TextCursorHelper.hxx>
41 #include <unoframe.hxx>
42 #include <doc.hxx>
45 #include <fmtfsize.hxx>
46 #include <fmtanchr.hxx>
47 #include <fmtcntnt.hxx>
48 #include "xmlimp.hxx"
49 #include "xmltbli.hxx"
50 #include "xmltexti.hxx"
53 #include <SwAppletImpl.hxx>
54 #include <ndole.hxx>
55 #include <docsh.hxx>
56 #include <sfx2/docfile.hxx>
57 #include <vcl/svapp.hxx>
59 #include <svtools/embedhlp.hxx>
60 #include <svl/urihelper.hxx>
61 #include <sfx2/frmdescr.hxx>
62 #include <tools/globname.hxx>
63 
64 using namespace ::com::sun::star;
65 using namespace ::com::sun::star::uno;
66 using namespace ::com::sun::star::lang;
67 using namespace ::com::sun::star::text;
68 using namespace ::com::sun::star::frame;
69 using namespace ::com::sun::star::beans;
70 using namespace xml::sax;
71 
72 namespace {
73 
74 struct XMLServiceMapEntry_Impl
75 {
76  const char *sFilterService;
77  sal_Int32 nFilterServiceLen;
78 
79  sal_uInt32 n1;
80  sal_uInt16 n2, n3;
81  sal_uInt8 n4, n5, n6, n7, n8, n9, n10, n11;
82 };
83 
84 }
85 
86 #define SERVICE_MAP_ENTRY( app, s ) \
87  { XML_IMPORT_FILTER_##app, sizeof(XML_IMPORT_FILTER_##app)-1, \
88  SO3_##s##_CLASSID }
89 
90 const XMLServiceMapEntry_Impl aServiceMap[] =
91 {
93  SERVICE_MAP_ENTRY( CALC, SC ),
94  SERVICE_MAP_ENTRY( DRAW, SDRAW ),
95  SERVICE_MAP_ENTRY( IMPRESS, SIMPRESS ),
96  SERVICE_MAP_ENTRY( CHART, SCH ),
97  SERVICE_MAP_ENTRY( MATH, SM ),
98  { nullptr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
99 };
100 static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet,
101  sal_Int32 nHeight, sal_Int32 nWidth,
102  Size *pTwipSize = nullptr )
103 {
104  if( nWidth > 0 && nHeight > 0 )
105  {
106  nWidth = convertMm100ToTwip( nWidth );
107  if( nWidth < MINFLY )
108  nWidth = MINFLY;
109  nHeight = convertMm100ToTwip( nHeight );
110  if( nHeight < MINFLY )
111  nHeight = MINFLY;
112  rItemSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, nWidth, nHeight ) );
113  }
114 
115  SwFormatAnchor aAnchor( RndStdIds::FLY_AT_CHAR );
116  rItemSet.Put( aAnchor );
117 
118  if( pTwipSize )
119  {
120  pTwipSize->setWidth( nWidth );
121  pTwipSize->setHeight( nHeight);
122  }
123 }
124 
125 static void lcl_setObjectVisualArea( const uno::Reference< embed::XEmbeddedObject >& xObj,
126  sal_Int64 nAspect,
127  const Size& aVisSize,
128  const MapUnit& aUnit )
129 {
130  if( xObj.is() && nAspect != embed::Aspects::MSOLE_ICON )
131  {
132  // convert the visual area to the objects units
133  MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
134  Size aObjVisSize = OutputDevice::LogicToLogic(aVisSize, MapMode(aUnit), MapMode(aObjUnit));
135  awt::Size aSz;
136  aSz.Width = aObjVisSize.Width();
137  aSz.Height = aObjVisSize.Height();
138 
139  try
140  {
141  xObj->setVisualAreaSize( nAspect, aSz );
142  }
143  catch( uno::Exception& )
144  {
145  OSL_FAIL( "Couldn't set visual area of the object!" );
146  }
147  }
148 }
149 
151  const uno::Reference < XModel>& rModel,
152  SvXMLImport& rImport,
153  const uno::Reference<XPropertySet> & rInfoSet,
154  bool bInsertM, bool bStylesOnlyM,
155  bool bBlockM, bool bOrganizerM ) :
156  XMLTextImportHelper( rModel, rImport, bInsertM, bStylesOnlyM, true/*bProgress*/,
157  bBlockM, bOrganizerM ),
158  pRedlineHelper( nullptr )
159 {
160  uno::Reference<XPropertySet> xDocPropSet( rModel, UNO_QUERY );
162  bInsertM || bBlockM, xDocPropSet, rInfoSet );
163 }
164 
166 {
167  // the redline helper destructor sets properties on the document
168  // and may throw an exception while doing so... catch this
169  try
170  {
171  delete pRedlineHelper;
172  }
173  catch ( const RuntimeException& )
174  {
175  // ignore
176  }
177 }
178 
180  SvXMLImport& rImport,
181  sal_uInt16 nPrefix, const OUString& rLocalName,
182  const uno::Reference< XAttributeList > & xAttrList )
183 {
184  return new SwXMLTableContext(
185  static_cast<SwXMLImport&>(rImport), nPrefix, rLocalName, xAttrList );
186 }
187 
189 {
190  uno::Reference<XUnoTunnel> xCursorTunnel(
191  const_cast<SwXMLTextImportHelper *>(this)->GetCursor(), UNO_QUERY );
192  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
193  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
194  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
195  SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing");
196  SwDoc *pDoc = pTextCursor ? pTextCursor->GetDoc() : nullptr;
197 
198  return pDoc && pDoc->IsInHeaderFooter( pTextCursor->GetPaM()->GetPoint()->nNode );
199 }
200 
201 static SwOLENode *lcl_GetOLENode( const SwFrameFormat *pFrameFormat )
202 {
203  SwOLENode *pOLENd = nullptr;
204  if( pFrameFormat )
205  {
206  const SwFormatContent& rContent = pFrameFormat->GetContent();
207  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
208  pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode();
209  }
210  OSL_ENSURE( pOLENd, "Where is the OLE node" );
211  return pOLENd;
212 }
213 
214 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
215  SvXMLImport& rImport,
216  const OUString& rHRef,
217  const OUString& rStyleName,
218  const OUString& rTableName,
219  sal_Int32 nWidth, sal_Int32 nHeight )
220 {
221  // this method will modify the document directly -> lock SolarMutex
222  SolarMutexGuard aGuard;
223 
224  uno::Reference < XPropertySet > xPropSet;
225 
226  sal_Int32 nPos = rHRef.indexOf( ':' );
227  if( -1 == nPos )
228  return xPropSet;
229 
230  OUString aObjName( rHRef.copy( nPos+1) );
231 
232  if( aObjName.isEmpty() )
233  return xPropSet;
234 
235  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
236  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
237  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
238  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
239  SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing");
240  SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport );
241 
243  RES_FRMATR_END>{} );
244  Size aTwipSize( 0, 0 );
245  tools::Rectangle aVisArea( 0, 0, nWidth, nHeight );
246  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
247  &aTwipSize );
248 
249  SwFrameFormat *pFrameFormat = nullptr;
250  SwOLENode *pOLENd = nullptr;
251  if( rHRef.startsWith("vnd.sun.star.ServiceName:") )
252  {
253  bool bInsert = false;
254  SvGlobalName aClassName;
255  const XMLServiceMapEntry_Impl *pEntry = aServiceMap;
256  while( pEntry->sFilterService )
257  {
258  if( aObjName.equalsAsciiL( pEntry->sFilterService,
259  pEntry->nFilterServiceLen ) )
260  {
261  aClassName = SvGlobalName( pEntry->n1, pEntry->n2,
262  pEntry->n3, pEntry->n4,
263  pEntry->n5, pEntry->n6,
264  pEntry->n7, pEntry->n8,
265  pEntry->n9, pEntry->n10,
266  pEntry->n11 );
267  bInsert = true;
268  break;
269  }
270  pEntry++;
271  }
272 
273  if( bInsert )
274  {
275  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
276  try
277  {
278  // create object with desired ClassId
279  uno::Sequence < sal_Int8 > aClass( aClassName.GetByteSequence() );
280  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
281  uno::Sequence<beans::PropertyValue> aObjArgs( comphelper::InitPropertySequence({
282  { "DefaultParentBaseURL", Any(GetXMLImport().GetBaseURL()) }
283  }));
284  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
285  aClass, OUString(), xStorage, "DummyName", aObjArgs), uno::UNO_QUERY );
286  if ( xObj.is() )
287  {
288  //TODO/LATER: is it enough to only set the VisAreaSize?
289  lcl_setObjectVisualArea( xObj, embed::Aspects::MSOLE_CONTENT, aTwipSize, MapUnit::MapTwip );
290  }
291 
292  if( pTextCursor )
293  {
294  pFrameFormat = pDoc->getIDocumentContentOperations().InsertEmbObject(
295  *pTextCursor->GetPaM(),
296  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
297  &aItemSet);
298  pOLENd = lcl_GetOLENode( pFrameFormat );
299  }
300 
301  if( pOLENd )
302  aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
303  }
304  catch ( uno::Exception& )
305  {
306  }
307  }
308  }
309  else
310  {
311  // check whether an object with this name already exists in the document
312  OUString aName;
314  for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
315  {
316  SwOLENode* pExistingOLENd = pNd->GetOLENode();
317  if( pExistingOLENd )
318  {
319  OUString aExistingName = pExistingOLENd->GetOLEObj().GetCurrentPersistName();
320  if ( aExistingName == aObjName )
321  {
322  OSL_FAIL( "The document contains duplicate object references, means it is partially broken, please let developers know how this document was generated!" );
323 
324  OUString aTmpName = pDoc->GetPersist()->GetEmbeddedObjectContainer().CreateUniqueObjectName();
325  try
326  {
327  pDoc->GetPersist()->GetStorage()->copyElementTo( aObjName,
328  pDoc->GetPersist()->GetStorage(),
329  aTmpName );
330  aName = aTmpName;
331  }
332  catch ( uno::Exception& )
333  {
334  OSL_FAIL( "Couldn't create a copy of the object!" );
335  }
336 
337  break;
338  }
339  }
340  }
341 
342  if ( aName.isEmpty() )
343  aName = aObjName;
344 
345  // the correct aspect will be set later
346  // TODO/LATER: Actually it should be set here
347  if( pTextCursor )
348  {
349  pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( *pTextCursor->GetPaM(), aName, embed::Aspects::MSOLE_CONTENT, &aItemSet, nullptr );
350  pOLENd = lcl_GetOLENode( pFrameFormat );
351  }
352  aObjName = aName;
353  }
354 
355  if( !pFrameFormat )
356  return xPropSet;
357 
358  if( IsInsertMode() )
359  {
360  if( !pOLENd )
361  pOLENd = lcl_GetOLENode( pFrameFormat );
362  if( pOLENd )
363  pOLENd->SetOLESizeInvalid( true );
364  }
365 
367  *pDoc, pFrameFormat), uno::UNO_QUERY);
369  {
370  // req for z-order
371  SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat));
372  }
373  if( !rTableName.isEmpty() )
374  {
375  const SwFormatContent& rContent = pFrameFormat->GetContent();
376  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
377  SwOLENode *pOLENode = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetOLENode();
378  OSL_ENSURE( pOLENode, "Where is the OLE node" );
379 
380  OUStringBuffer aBuffer( rTableName.getLength() );
381  bool bQuoted = false;
382  bool bEscape = false;
383  bool bError = false;
384  for( sal_Int32 i=0; i < rTableName.getLength(); i++ )
385  {
386  bool bEndOfNameFound = false;
387  sal_Unicode c = rTableName[i];
388  switch( c )
389  {
390  case '\'':
391  if( bEscape )
392  {
393  aBuffer.append( c );
394  bEscape = false;
395  }
396  else if( bQuoted )
397  {
398  bEndOfNameFound = true;
399  }
400  else if( 0 == i )
401  {
402  bQuoted = true;
403  }
404  else
405  {
406  bError = true;
407  }
408  break;
409  case '\\':
410  if( bEscape )
411  {
412  aBuffer.append( c );
413  bEscape = false;
414  }
415  else
416  {
417  bEscape = true;
418  }
419  break;
420  case ' ':
421  case '.':
422  if( !bQuoted )
423  {
424  bEndOfNameFound = true;
425  }
426  else
427  {
428  aBuffer.append( c );
429  bEscape = false;
430  }
431  break;
432  default:
433  {
434  aBuffer.append( c );
435  bEscape = false;
436  }
437  break;
438  }
439  if( bError || bEndOfNameFound )
440  break;
441  }
442  if( !bError )
443  {
444  OUString sTableName( aBuffer.makeStringAndClear() );
445  pOLENode->SetChartTableName( GetRenameMap().Get( XML_TEXT_RENAME_TYPE_TABLE, sTableName ) );
446  }
447  }
448 
449  sal_Int64 nDrawAspect = 0;
450  const XMLPropStyleContext *pStyle = nullptr;
451  bool bHasSizeProps = false;
452  if( !rStyleName.isEmpty() )
453  {
454  pStyle = FindAutoFrameStyle( rStyleName );
455  if( pStyle )
456  {
458  pStyle->GetStyles()
459  ->GetImportPropertyMapper(pStyle->GetFamily());
460  OSL_ENSURE( xImpPrMap.is(), "Where is the import prop mapper?" );
461  if( xImpPrMap.is() )
462  {
464  xImpPrMap->getPropertySetMapper();
465 
466  sal_Int32 nCount = pStyle->GetProperties().size();
467  for( sal_Int32 i=0; i < nCount; i++ )
468  {
469  const XMLPropertyState& rProp = pStyle->GetProperties()[i];
470  sal_Int32 nIdx = rProp.mnIndex;
471  if( -1 == nIdx )
472  continue;
473 
474  switch( rPropMapper->GetEntryContextId(nIdx) )
475  {
477  {
478  sal_Int32 nVal = 0;
479  rProp.maValue >>= nVal;
480  aVisArea.setX( nVal );
481  }
482  break;
484  {
485  sal_Int32 nVal = 0;
486  rProp.maValue >>= nVal;
487  aVisArea.setY( nVal );
488  }
489  break;
491  {
492  sal_Int32 nVal = 0;
493  rProp.maValue >>= nVal;
494  aVisArea.setWidth( nVal );
495  bHasSizeProps = true;
496  }
497  break;
499  {
500  sal_Int32 nVal = 0;
501  rProp.maValue >>= nVal;
502  aVisArea.setHeight( nVal );
503  bHasSizeProps = true;
504  }
505  break;
506  case CTF_OLE_DRAW_ASPECT:
507  {
508  rProp.maValue >>= nDrawAspect;
509 
510  if ( !nDrawAspect )
511  nDrawAspect = embed::Aspects::MSOLE_CONTENT;
512 
513  if ( pOLENd )
514  pOLENd->GetOLEObj().GetObject().SetViewAspect( nDrawAspect );
515  }
516  break;
517  }
518  }
519  }
520  }
521  }
522 
523  if ( bHasSizeProps )
524  {
525  uno::Reference < embed::XEmbeddedObject > xObj =
527  if( xObj.is() )
528  lcl_setObjectVisualArea( xObj, ( nDrawAspect ? nDrawAspect : embed::Aspects::MSOLE_CONTENT ),
529  aVisArea.GetSize(), MapUnit::Map100thMM );
530  }
531 
532  return xPropSet;
533 }
534 
535 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
536  SvXMLImport& rImport,
537  const OUString& rHRef,
538  const OUString& /*rStyleName*/,
539  const OUString& /*rTableName*/,
540  sal_Int32 nWidth, sal_Int32 nHeight )
541 {
542  // this method will modify the document directly -> lock SolarMutex
543  SolarMutexGuard aGuard;
544 
545  uno::Reference < XPropertySet > xPropSet;
546 
547  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
548  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
549  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
550  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
551  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
552  SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport );
553 
555  RES_FRMATR_END>{} );
556  Size aTwipSize( 0, 0 );
557  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
558  &aTwipSize );
559 
560  // We'll need a (valid) URL. If we don't have do not insert the link and return early.
561  // Copy URL into URL object on the way.
562  INetURLObject aURLObj;
563  bool bValidURL = !rHRef.isEmpty() &&
565  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
566  if( !bValidURL )
567  return xPropSet;
568 
569  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
570  try
571  {
572  // create object with desired ClassId
573  uno::Reference < embed::XEmbeddedObjectCreator > xFactory =
574  embed::OOoEmbeddedObjectFactory::create(::comphelper::getProcessComponentContext());
575 
576  uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 );
577  aMediaDescriptor[0].Name = "URL";
578  aMediaDescriptor[0].Value <<= aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
579 
580  if (SfxMedium* pMedium = pDoc->GetDocShell() ? pDoc->GetDocShell()->GetMedium() : nullptr)
581  {
582  uno::Reference< task::XInteractionHandler > xInteraction = pMedium->GetInteractionHandler();
583  if ( xInteraction.is() )
584  {
585  aMediaDescriptor.realloc( 2 );
586  aMediaDescriptor[1].Name = "InteractionHandler";
587  aMediaDescriptor[1].Value <<= xInteraction;
588  }
589 
590  const auto nLen = aMediaDescriptor.getLength() + 1;
591  aMediaDescriptor.realloc(nLen);
592  aMediaDescriptor[nLen - 1].Name = "Referer";
593  aMediaDescriptor[nLen - 1].Value <<= pMedium->GetName();
594  }
595 
596  uno::Reference < embed::XEmbeddedObject > xObj(
597  xFactory->createInstanceLink(
598  xStorage, "DummyName", aMediaDescriptor, uno::Sequence< beans::PropertyValue >() ),
599  uno::UNO_QUERY_THROW );
600 
601  {
602  SwFrameFormat *const pFrameFormat =
604  *pTextCursor->GetPaM(),
605  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
606  &aItemSet );
607 
608  // 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???
609 
611  *pDoc, pFrameFormat), uno::UNO_QUERY);
613  {
615  static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order
616  }
617  }
618  }
619  catch ( uno::Exception& )
620  {
621  }
622 
623  // TODO/LATER: should the rStyleName and rTableName be handled as for usual embedded object?
624 
625  return xPropSet;
626 }
627 
628 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet(
629  const OUString &rName,
630  const OUString &rCode,
631  bool bMayScript,
632  const OUString& rHRef,
633  sal_Int32 nWidth, sal_Int32 nHeight )
634 {
635  // this method will modify the document directly -> lock SolarMutex
636  SolarMutexGuard aGuard;
637 
638  uno::Reference < XPropertySet > xPropSet;
639  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
640  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
641  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
642  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
643  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
644  SwDoc *pDoc = pTextCursor->GetDoc();
645 
647  RES_FRMATR_END>{} );
648  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
649 
650  SwApplet_Impl aAppletImpl ( aItemSet );
651 
652  OUString sCodeBase;
653  if( !rHRef.isEmpty() )
654  sCodeBase = GetXMLImport().GetAbsoluteReference( rHRef );
655 
656  aAppletImpl.CreateApplet ( rCode, rName, bMayScript, sCodeBase, GetXMLImport().GetDocumentBase() );
657 
658  // set the size of the applet
659  lcl_setObjectVisualArea( aAppletImpl.GetApplet(),
660  embed::Aspects::MSOLE_CONTENT,
661  Size( nWidth, nHeight ),
662  MapUnit::Map100thMM );
663 
664  SwFrameFormat *const pFrameFormat =
665  pDoc->getIDocumentContentOperations().InsertEmbObject( *pTextCursor->GetPaM(),
666  ::svt::EmbeddedObjectRef(aAppletImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT),
667  &aAppletImpl.GetItemSet());
669  *pDoc, pFrameFormat), uno::UNO_QUERY);
671  {
672  // req for z-order
673  SwXFrame::GetOrCreateSdrObject(*static_cast<SwFlyFrameFormat*>(pFrameFormat));
674  }
675 
676  return xPropSet;
677 }
678 
679 uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin(
680  const OUString &rMimeType,
681  const OUString& rHRef,
682  sal_Int32 nWidth, sal_Int32 nHeight )
683 {
684  uno::Reference < XPropertySet > xPropSet;
685  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
686  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
687  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
688  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
689  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
690  SwDoc *pDoc = pTextCursor->GetDoc();
691 
693  RES_FRMATR_END>{} );
694  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
695 
696  // We'll need a (valid) URL, or we need a MIME type. If we don't have
697  // either, do not insert plugin and return early. Copy URL into URL object
698  // on the way.
699  INetURLObject aURLObj;
700 
701  bool bValidURL = !rHRef.isEmpty() &&
702  aURLObj.SetURL( URIHelper::SmartRel2Abs( INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) );
703  bool bValidMimeType = !rMimeType.isEmpty();
704  if( !bValidURL && !bValidMimeType )
705  return xPropSet;
706 
707  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
708  try
709  {
710  // create object with desired ClassId
711  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence() );
712  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
713  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
714  aClass, OUString(), xStorage, "DummyName",
715  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
716 
717  // set size to the object
719  embed::Aspects::MSOLE_CONTENT,
720  Size( nWidth, nHeight ),
721  MapUnit::Map100thMM );
722 
724  {
725  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
726  if ( xSet.is() )
727  {
728  if( bValidURL )
729  xSet->setPropertyValue("PluginURL",
731  if( bValidMimeType )
732  xSet->setPropertyValue("PluginMimeType",
733  makeAny( rMimeType ) );
734  }
735 
736  SwFrameFormat *const pFrameFormat =
738  *pTextCursor->GetPaM(),
739  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
740  &aItemSet);
742  *pDoc, pFrameFormat), uno::UNO_QUERY);
744  {
746  static_cast<SwFlyFrameFormat*>(pFrameFormat)); // req for z-order
747  }
748  }
749  }
750  catch ( uno::Exception& )
751  {
752  }
753 
754  return xPropSet;
755 }
757  const OUString& rName,
758  const OUString& rHRef,
759  const OUString& rStyleName,
760  sal_Int32 nWidth, sal_Int32 nHeight )
761 {
762  // this method will modify the document directly -> lock SolarMutex
763  SolarMutexGuard aGuard;
764 
765  uno::Reference < XPropertySet > xPropSet;
766  uno::Reference<XUnoTunnel> xCursorTunnel( GetCursor(), UNO_QUERY );
767  assert(xCursorTunnel.is() && "missing XUnoTunnel for Cursor");
768  OTextCursorHelper *pTextCursor = reinterpret_cast< OTextCursorHelper * >(
769  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )));
770  OSL_ENSURE( pTextCursor, "SwXTextCursor missing" );
771  SwDoc *pDoc = pTextCursor->GetDoc();
772 
774  RES_FRMATR_END>{} );
775  lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
776 
777  ScrollingMode eScrollMode = ScrollingMode::Auto;
778  bool bHasBorder = false;
779  bool bIsBorderSet = false;
780  Size aMargin( SIZE_NOT_SET, SIZE_NOT_SET );
781  const XMLPropStyleContext *pStyle = nullptr;
782  if( !rStyleName.isEmpty() )
783  {
784  pStyle = FindAutoFrameStyle( rStyleName );
785  if( pStyle )
786  {
788  pStyle->GetStyles()
789  ->GetImportPropertyMapper(pStyle->GetFamily());
790  OSL_ENSURE( xImpPrMap.is(), "Where is the import prop mapper?" );
791  if( xImpPrMap.is() )
792  {
794  xImpPrMap->getPropertySetMapper();
795 
796  sal_Int32 nCount = pStyle->GetProperties().size();
797  for( sal_Int32 i=0; i < nCount; i++ )
798  {
799  const XMLPropertyState& rProp = pStyle->GetProperties()[i];
800  sal_Int32 nIdx = rProp.mnIndex;
801  if( -1 == nIdx )
802  continue;
803 
804  switch( rPropMapper->GetEntryContextId(nIdx) )
805  {
807  {
808  bool bYes = *o3tl::doAccess<bool>(rProp.maValue);
809  eScrollMode = bYes ? ScrollingMode::Yes : ScrollingMode::No;
810  }
811  break;
813  {
814  bHasBorder = *o3tl::doAccess<bool>(rProp.maValue);
815  bIsBorderSet = true;
816  }
817  break;
819  {
820  sal_Int32 nVal = SIZE_NOT_SET;
821  rProp.maValue >>= nVal;
822  aMargin.setWidth( nVal );
823  }
824  break;
826  {
827  sal_Int32 nVal = SIZE_NOT_SET;
828  rProp.maValue >>= nVal;
829  aMargin.setHeight( nVal );
830  }
831  break;
832  }
833  }
834  }
835  }
836  }
837 
838  uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
839  try
840  {
841  // create object with desired ClassId
842  uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence() );
843  uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() );
844  uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceInitNew(
845  aClass, OUString(), xStorage, "DummyName",
846  uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY );
847 
848  // set size to the object
850  embed::Aspects::MSOLE_CONTENT,
851  Size( nWidth, nHeight ),
852  MapUnit::Map100thMM );
853 
855  {
856  uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
857  if ( xSet.is() )
858  {
859  xSet->setPropertyValue("FrameURL",
861  INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) ) );
862 
863  xSet->setPropertyValue("FrameName",
864  makeAny( rName ) );
865 
866  if ( eScrollMode == ScrollingMode::Auto )
867  xSet->setPropertyValue("FrameIsAutoScroll",
868  makeAny( true ) );
869  else
870  xSet->setPropertyValue("FrameIsScrollingMode",
871  makeAny( eScrollMode == ScrollingMode::Yes ) );
872 
873  if ( bIsBorderSet )
874  xSet->setPropertyValue("FrameIsBorder",
875  makeAny( bHasBorder ) );
876  else
877  xSet->setPropertyValue("FrameIsAutoBorder",
878  makeAny( true ) );
879 
880  xSet->setPropertyValue("FrameMarginWidth",
881  makeAny( sal_Int32( aMargin.Width() ) ) );
882 
883  xSet->setPropertyValue("FrameMarginHeight",
884  makeAny( sal_Int32( aMargin.Height() ) ) );
885  }
886 
887  SwFrameFormat *const pFrameFormat =
889  *pTextCursor->GetPaM(),
890  ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
891  &aItemSet);
893  *pDoc, pFrameFormat), uno::UNO_QUERY);
895  {
896  // req for z-order
898  static_cast<SwFlyFrameFormat*>(pFrameFormat));
899  }
900  }
901  }
902  catch ( uno::Exception& )
903  {
904  }
905 
906  return xPropSet;
907 }
908 
910  const uno::Reference < XPropertySet > &rPropSet,
911  std::map < const OUString, OUString > &rParamMap)
912 {
913  // this method will modify the document directly -> lock SolarMutex
914  SolarMutexGuard aGuard;
915 
916  uno::Reference<XUnoTunnel> xCursorTunnel( rPropSet, UNO_QUERY );
917  assert(xCursorTunnel.is() && "missing XUnoTunnel for embedded");
918  SwXFrame *pFrame = reinterpret_cast< SwXFrame * >(
919  sal::static_int_cast< sal_IntPtr >( xCursorTunnel->getSomething( SwXFrame::getUnoTunnelId() )));
920  OSL_ENSURE( pFrame, "SwXFrame missing" );
921  SwFrameFormat *pFrameFormat = pFrame->GetFrameFormat();
922  const SwFormatContent& rContent = pFrameFormat->GetContent();
923  const SwNodeIndex *pNdIdx = rContent.GetContentIdx();
924  SwOLENode *pOLENd = pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTextNode()->GetOLENode();
925  SwOLEObj& rOLEObj = pOLENd->GetOLEObj();
926 
927  uno::Reference < embed::XEmbeddedObject > xEmbObj( rOLEObj.GetOleRef() );
929  {
930  uno::Reference < beans::XPropertySet > xSet( xEmbObj->getComponent(), uno::UNO_QUERY );
931  if ( xSet.is() )
932  {
933  const sal_Int32 nCount = rParamMap.size();
934  uno::Sequence< beans::PropertyValue > aCommandSequence( nCount );
935 
936  sal_Int32 nIndex=0;
937  for (const auto& rParam : rParamMap )
938  {
939  aCommandSequence[nIndex].Name = rParam.first;
940  aCommandSequence[nIndex].Handle = -1;
941  aCommandSequence[nIndex].Value <<= rParam.second;
942  aCommandSequence[nIndex].State = beans::PropertyState_DIRECT_VALUE;
943  ++nIndex;
944  }
945 
946  // unfortunately the names of the properties are depending on the object
947  OUString aParaName("AppletCommands");
948  try
949  {
950  xSet->setPropertyValue( aParaName, makeAny( aCommandSequence ) );
951  }
952  catch ( uno::Exception& )
953  {
954  aParaName = "PluginCommands";
955  try
956  {
957  xSet->setPropertyValue( aParaName, makeAny( aCommandSequence ) );
958  }
959  catch ( uno::Exception& )
960  {
961  }
962  }
963  }
964  }
965 }
966 
967 // redlining helper methods
968 // (override to provide the real implementation)
970  const OUString& rType,
971  const OUString& rId,
972  const OUString& rAuthor,
973  const OUString& rComment,
974  const util::DateTime& rDateTime,
975  bool bMergeLastPara)
976 {
977  // create redline helper on demand
978  OSL_ENSURE(nullptr != pRedlineHelper, "helper should have been created in constructor");
979  if (nullptr != pRedlineHelper)
980  pRedlineHelper->Add(rType, rId, rAuthor, rComment, rDateTime,
981  bMergeLastPara);
982 }
983 
984 uno::Reference<XTextCursor> SwXMLTextImportHelper::RedlineCreateText(
985  uno::Reference<XTextCursor> & rOldCursor,
986  const OUString& rId)
987 {
988  uno::Reference<XTextCursor> xRet;
989 
990  if (nullptr != pRedlineHelper)
991  {
992  xRet = pRedlineHelper->CreateRedlineTextSection(rOldCursor, rId);
993  }
994 
995  return xRet;
996 }
997 
999  const OUString& rId,
1000  bool bStart,
1001  bool bIsOutsideOfParagraph)
1002 {
1003  if (nullptr != pRedlineHelper) {
1004  uno::Reference<XTextRange> xTextRange( GetCursor()->getStart() );
1005  pRedlineHelper->SetCursor(rId, bStart, xTextRange,
1006  bIsOutsideOfParagraph);
1007  }
1008  // else: ignore redline (wasn't added before, else we'd have a helper)
1009 }
1010 
1012 {
1013  OUString rId = GetOpenRedlineId();
1014  if ((nullptr != pRedlineHelper) && !rId.isEmpty())
1015  {
1018  }
1019  // else: ignore redline (wasn't added before, or no open redline ID
1020 }
1021 
1022 void SwXMLTextImportHelper::SetShowChanges( bool bShowChanges )
1023 {
1024  if ( nullptr != pRedlineHelper )
1025  pRedlineHelper->SetShowChanges( bShowChanges );
1026 }
1027 
1028 void SwXMLTextImportHelper::SetRecordChanges( bool bRecordChanges )
1029 {
1030  if ( nullptr != pRedlineHelper )
1031  pRedlineHelper->SetRecordChanges( bRecordChanges );
1032 }
1033 
1035  const Sequence<sal_Int8> & rKey )
1036 {
1037  if ( nullptr != pRedlineHelper )
1039 }
1040 
1041 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
const css::uno::Reference< css::embed::XEmbeddedObject > & GetApplet() const
XmlStyleFamily GetFamily() const
#define SERVICE_MAP_ENTRY(app, s)
Definition: xmltexti.cxx:86
sal_Int32 nIndex
void setHeight(long n)
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:984
css::uno::Reference< css::text::XTextCursor > & GetCursor()
virtual void SetRecordChanges(bool bRecordChanges) override
Definition: xmltexti.cxx:1028
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
SwDocShell * GetDocShell()
Definition: doc.hxx:1348
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
long Height() const
int n1
const ::std::vector< XMLPropertyState > & GetProperties() const
#define SO3_IFRAME_CLASSID
#define MINFLY
Definition: swtypes.hxx:65
virtual void RedlineSetCursor(const OUString &rId, bool bStart, bool bIsOutsideOfParagraph) override
ID used to RedlineAdd() call.
Definition: xmltexti.cxx:998
#define CTF_FRAME_MARGIN_HORI
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:913
Definition: doc.hxx:184
#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
SfxItemSet & GetItemSet()
void SetCursor(const OUString &rId, bool bStart, css::uno::Reference< css::text::XTextRange > const &rRange, bool bIsOusideOfParagraph)
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
#define CTF_FRAME_DISPLAY_SCROLLBAR
SvI18NMap & GetRenameMap()
CALC
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:314
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
Definition: doclay.cxx:1552
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:535
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:756
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:154
css::uno::Reference< css::embed::XStorage > const & GetStorage()
void SetRecordChanges(bool bRecordChanges)
sal_uInt16 sal_Unicode
int n2
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:969
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void SetProtectionKey(const css::uno::Sequence< sal_Int8 > &rKey)
DRAW
void SetShowChanges(bool bShowChanges)
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:965
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:628
int nCount
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
void CreateApplet(const OUString &rCode, const OUString &rName, bool bMayScript, const OUString &rCodeBase, const OUString &rBaseURL)
virtual SvXMLImportContext * CreateTableChildContext(SvXMLImport &rImport, sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Definition: xmltexti.cxx:179
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 XMLServiceMapEntry_Impl aServiceMap[]
Definition: xmltexti.cxx:90
const OUString & GetCurrentPersistName() const
Definition: ndole.hxx:69
css::uno::Reference< css::text::XTextCursor > CreateRedlineTextSection(css::uno::Reference< css::text::XTextCursor > const &xOldCursor, const OUString &rId)
void setWidth(long n)
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertPlugin(const OUString &rMimeType, const OUString &rHRef, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: xmltexti.cxx:679
virtual void SetShowChanges(bool bShowChanges) override
Definition: xmltexti.cxx:1022
#define XML_TEXT_RENAME_TYPE_TABLE
WRITER
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:214
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:57
int i
SvXMLImport & GetXMLImport()
void setY(long y)
MATH
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:909
static SdrObject * GetOrCreateSdrObject(SwFlyFrameFormat &rFormat)
Definition: unoframe.cxx:1353
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:150
virtual bool IsInHeaderFooter() const override
Definition: xmltexti.cxx:188
Marks a node in the document model.
Definition: ndindex.hxx:31
virtual ~SwXMLTextImportHelper() override
Definition: xmltexti.cxx:165
bool IsInsertMode() const
#define CTF_FRAME_DISPLAY_BORDER
static SwOLENode * lcl_GetOLENode(const SwFrameFormat *pFrameFormat)
Definition: xmltexti.cxx:201
static void lcl_setObjectVisualArea(const uno::Reference< embed::XEmbeddedObject > &xObj, sal_Int64 nAspect, const Size &aVisSize, const MapUnit &aUnit)
Definition: xmltexti.cxx:125
#define CTF_FRAME_MARGIN_VERT
Frame cannot be moved in Var-direction.
#define CTF_OLE_DRAW_ASPECT
Size GetSize() const
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:1034
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
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:153
void AdjustStartNodeCursor(const OUString &rId)
Adjust the start (end) position for a redline that begins in a start node.
constexpr sal_uInt16 RES_FRMATR_END(131)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
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:100
#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)
unsigned char sal_uInt8
const SwNodes & GetNodes() const
Definition: ndindex.hxx:156
void Add(const OUString &rType, const OUString &rId, const OUString &rAuthor, const OUString &rComment, const css::util::DateTime &rDateTime, bool bMergeLastParagraph)
XMLPropStyleContext * FindAutoFrameStyle(const OUString &rName) const
OUString aName
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:615
Reference< XComponentContext > getProcessComponentContext()
IMPRESS
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
void SetOLESizeInvalid(bool b)
Definition: ndole.hxx:134
virtual void RedlineAdjustStartNodeCursor() override
Definition: xmltexti.cxx:1011
MapUnit
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoframe.cxx:1163
Reference< XSingleServiceFactory > xFactory
bool SetURL(OUString const &rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
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:3445
void setX(long x)
SwDoc * GetDocFromXMLImport(SvXMLImport const &)
Definition: xmlimp.cxx:1689
const SwGrfFormatColl * GetDfltGrfFormatColl() const
Definition: doc.hxx:801
void setWidth(long nWidth)
#define SO3_PLUGIN_CLASSID
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
#define SIZE_NOT_SET
sal_uInt16 nPos
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1315
XMLRedlineImportHelper * pRedlineHelper
Definition: xmltexti.hxx:29
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)
void setHeight(long nHeight)
SfxMedium * GetMedium() const
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)