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