LibreOffice Module svx (master)  1
galmisc.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 
20 #include <sal/config.h>
21 
22 #include <sot/storage.hxx>
23 #include <unotools/streamwrap.hxx>
25 #include <comphelper/string.hxx>
26 #include <ucbhelper/content.hxx>
27 #include <com/sun/star/ucb/ContentCreationException.hpp>
28 #include <unotools/resmgr.hxx>
29 #include <tools/urlobj.hxx>
30 #include <svl/solar.hrc>
31 #include <svl/urihelper.hxx>
32 #include <vcl/graphicfilter.hxx>
33 #include <svl/itempool.hxx>
34 #include <sfx2/docfile.hxx>
35 #include <avmedia/mediawindow.hxx>
36 #include <vcl/svapp.hxx>
37 #include <vcl/settings.hxx>
38 #include <svx/svdpage.hxx>
39 #include <svx/dialmgr.hxx>
40 #include <svx/svdograf.hxx>
41 #include <svx/fmmodel.hxx>
42 #include <svx/fmview.hxx>
43 #include <svx/unomodel.hxx>
44 #include "codec.hxx"
45 #include <svx/strings.hrc>
46 #include <svx/gallery1.hxx>
47 #include <svx/galtheme.hxx>
48 #include <svx/galmisc.hxx>
49 #include <com/sun/star/awt/XProgressMonitor.hpp>
50 #include <com/sun/star/sdbc/XResultSet.hpp>
51 #include <com/sun/star/ucb/XContentAccess.hpp>
52 #include <com/sun/star/ucb/TransferInfo.hpp>
53 #include <com/sun/star/ucb/NameClash.hpp>
54 #include <memory>
55 
56 using namespace ::com::sun::star;
57 
58 BitmapEx GalleryResGetBitmapEx(const OUString &rId)
59 {
60  BitmapEx aBmpEx(rId);
61 
62  //TODO, check if any of these have no transparency layer
63  if (!aBmpEx.IsTransparent())
64  aBmpEx = BitmapEx(aBmpEx.GetBitmap(), COL_LIGHTMAGENTA);
65 
66  return aBmpEx;
67 }
68 
70  OUString& rFilterName )
71 {
73  SfxMedium aMedium( rURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ );
74 
75  aMedium.Download();
76 
77  SvStream* pIStm = aMedium.GetInStream();
78 
79  if( pIStm )
80  {
82  sal_uInt16 nFormat;
83 
84  if( !rGraphicFilter.ImportGraphic( rGraphic, rURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), *pIStm, GRFILTER_FORMAT_DONTKNOW, &nFormat ) )
85  {
86  rFilterName = rGraphicFilter.GetImportFormatName( nFormat );
88  }
89  }
90 
91  return nRet;
92 }
93 
94 bool GallerySvDrawImport( SvStream& rIStm, SdrModel& rModel )
95 {
96  sal_uInt32 nVersion;
97  bool bRet = false;
98 
99  if( GalleryCodec::IsCoded( rIStm, nVersion ) )
100  {
101  SvMemoryStream aMemStm( 65535, 65535 );
102  GalleryCodec aCodec( rIStm );
103 
104  aCodec.Read( aMemStm );
105  aMemStm.Seek( 0 );
106 
107  if( 1 == nVersion )
108  {
109  OSL_FAIL( "staroffice binary file formats are no longer supported inside the gallery!" );
110  bRet = false;
111  }
112  else if( 2 == nVersion )
113  {
114  // recall to read as XML
115  bRet = GallerySvDrawImport( aMemStm, rModel );
116  }
117  }
118  else
119  {
120  // read as XML
121  uno::Reference< io::XInputStream > xInputStream( new utl::OInputStreamWrapper( rIStm ) );
122 
123  rModel.GetItemPool().SetDefaultMetric( MapUnit::Map100thMM );
124  uno::Reference< lang::XComponent > xComponent;
125 
126  bRet = SvxDrawingLayerImport( &rModel, xInputStream, xComponent, "com.sun.star.comp.Draw.XMLOasisImporter" );
127  if( !bRet || (rModel.GetPageCount() == 0) )
128  {
129  rIStm.Seek(0);
130  bRet = SvxDrawingLayerImport( &rModel, xInputStream, xComponent, "com.sun.star.comp.Draw.XMLImporter" );
131  }
132 
133  }
134 
135  return bRet;
136 }
137 
138 bool CreateIMapGraphic( const FmFormModel& rModel, Graphic& rGraphic, ImageMap& rImageMap )
139 {
140  bool bRet = false;
141 
142  if ( rModel.GetPageCount() )
143  {
144  const SdrPage* pPage = rModel.GetPage( 0 );
145  const SdrObject* pObj = pPage->GetObj( 0 );
146 
147  if ( pPage->GetObjCount() == 1 && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr )
148  {
149  const sal_uInt16 nCount = pObj->GetUserDataCount();
150 
151  // Exist in the user data an IMap information?
152  for ( sal_uInt16 i = 0; i < nCount; i++ )
153  {
154  const SdrObjUserData* pUserData = pObj->GetUserData( i );
155 
156  if ( ( pUserData->GetInventor() == SdrInventor::SgaImap ) && ( pUserData->GetId() == ID_IMAPINFO ) )
157  {
158  rGraphic = static_cast<const SdrGrafObj*>( pObj )->GetGraphic();
159  rImageMap = static_cast<const SgaIMapInfo*>( pUserData )->GetImageMap();
160  bRet = true;
161  break;
162  }
163  }
164  }
165  }
166 
167  return bRet;
168 }
169 
170 OUString GetReducedString( const INetURLObject& rURL, sal_Int32 nMaxLen )
171 {
172  OUString aReduced( rURL.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous ) );
173 
174  aReduced = aReduced.copy(aReduced.lastIndexOf('/')+1);
175 
176  if( INetProtocol::PrivSoffice != rURL.GetProtocol() )
177  {
178  sal_Unicode aDelimiter;
179  const OUString aPath( rURL.getFSysPath( FSysStyle::Detect, &aDelimiter ) );
180  const OUString aName( aReduced );
181 
182  if( aPath.getLength() > nMaxLen )
183  {
184  sal_Int32 nPathPrefixLen = nMaxLen - aName.getLength() - 4;
185 
186  if (nPathPrefixLen >= 0)
187  {
188  aReduced = aPath.copy(0, nPathPrefixLen) + "..."
189  + OUStringChar(aDelimiter) + aName;
190  }
191  else
192  {
193  aReduced += "..." + OUStringChar(aDelimiter) + "..."
194  + aName.copy( aName.getLength() - (nMaxLen - 7) );
195  }
196  }
197  else
198  aReduced = aPath;
199  }
200 
201  return aReduced;
202 }
203 
204 OUString GetSvDrawStreamNameFromURL( const INetURLObject& rSvDrawObjURL )
205 {
206  OUString aRet;
207 
208  if( rSvDrawObjURL.GetProtocol() == INetProtocol::PrivSoffice &&
210  {
211  aRet = rSvDrawObjURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ).getToken( 2, '/' );
212  }
213 
214  return aRet;
215 }
216 
217 bool FileExists( const INetURLObject& rURL )
218 {
219  bool bRet = false;
220 
221  if( rURL.GetProtocol() != INetProtocol::NotValid )
222  {
223  try
224  {
225  ::ucbhelper::Content aCnt( rURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
226  OUString aTitle;
227 
228  aCnt.getPropertyValue("Title") >>= aTitle;
229  bRet = ( !aTitle.isEmpty() );
230  }
231  catch( const ucb::ContentCreationException& )
232  {
233  }
234  catch( const uno::RuntimeException& )
235  {
236  }
237  catch( const uno::Exception& )
238  {
239  }
240  }
241 
242  return bRet;
243 }
244 
245 bool CreateDir( const INetURLObject& rURL )
246 {
247  bool bRet = FileExists( rURL );
248 
249  if( !bRet )
250  {
251  try
252  {
253  uno::Reference< ucb::XCommandEnvironment > aCmdEnv;
254  INetURLObject aParentURL( rURL );
255  aParentURL.removeSegment();
257  uno::Sequence< OUString > aProps( 1 );
258  uno::Sequence< uno::Any > aValues( 1 );
259 
260  aProps[0] = "Title";
261  aValues[0] <<= rURL.GetLastName();
262 
264  bRet = aParent.insertNewContent( "application/vnd.sun.staroffice.fsys-folder", aProps, aValues, aContent );
265  }
266  catch( const ucb::ContentCreationException& )
267  {
268  }
269  catch( const uno::RuntimeException& )
270  {
271  }
272  catch( const uno::Exception& )
273  {
274  }
275  }
276 
277  return bRet;
278 }
279 
280 bool CopyFile( const INetURLObject& rSrcURL, const INetURLObject& rDstURL )
281 {
282  bool bRet = false;
283 
284  try
285  {
286  ::ucbhelper::Content aDestPath( rDstURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
287 
288  aDestPath.executeCommand( "transfer",
289  uno::makeAny( ucb::TransferInfo( false, rSrcURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ),
290  rDstURL.GetLastName(), ucb::NameClash::OVERWRITE ) ) );
291  bRet = true;
292  }
293  catch( const ucb::ContentCreationException& )
294  {
295  }
296  catch( const uno::RuntimeException& )
297  {
298  }
299  catch( const uno::Exception& )
300  {
301  }
302 
303  return bRet;
304 }
305 
306 bool KillFile( const INetURLObject& rURL )
307 {
308  bool bRet = FileExists( rURL );
309 
310  if( bRet )
311  {
312  try
313  {
314  ::ucbhelper::Content aCnt( rURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
315  aCnt.executeCommand( "delete", uno::makeAny( true ) );
316  }
317  catch( const ucb::ContentCreationException& )
318  {
319  bRet = false;
320  }
321  catch( const uno::RuntimeException& )
322  {
323  bRet = false;
324  }
325  catch( const uno::Exception& )
326  {
327  bRet = false;
328  }
329  }
330 
331  return bRet;
332 }
333 
334 
336 {
337 
338  uno::Reference< lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
339 
340  uno::Reference< awt::XProgressMonitor > xMonitor( xMgr->createInstance( "com.sun.star.awt.XProgressMonitor" ),
341  uno::UNO_QUERY );
342 
343  if ( xMonitor.is() )
344  {
345  mxProgressBar = xMonitor;
346 
347  OUString aProgressText;
348 
349  if( pFilter )
350  {
351  aProgressText = SvxResId(RID_SVXSTR_GALLERY_FILTER);
352 // pFilter->SetUpdatePercentHdl( LINK( this, GalleryProgress, Update ) ); // sj: progress wasn't working up from SO7 at all
353 // // so I am removing this. The gallery progress should
354 // // be changed to use the XStatusIndicator instead of XProgressMonitor
355  }
356  else
357  aProgressText = "Gallery";
358 
359  xMonitor->addText( "Gallery", aProgressText, false ) ;
360  mxProgressBar->setRange( 0, GALLERY_PROGRESS_RANGE );
361  }
362 }
363 
365 {
366 }
367 
368 void GalleryProgress::Update( sal_Int32 nVal, sal_Int32 nMaxVal )
369 {
370  if( mxProgressBar.is() && nMaxVal )
371  mxProgressBar->setValue( std::min<sal_Int32>( static_cast<double>(nVal) / nMaxVal * GALLERY_PROGRESS_RANGE,
372  GALLERY_PROGRESS_RANGE ) );
373 }
374 
375 
376 GalleryTransferable::GalleryTransferable( GalleryTheme* pTheme, sal_uInt32 nObjectPos, bool bLazy ) :
377  mpTheme( pTheme ),
378  meObjectKind( mpTheme->GetObjectKind( nObjectPos ) ),
379  mnObjectPos( nObjectPos )
380 {
381 
382  InitData( bLazy );
383 }
384 
386 {
387 }
388 
390 {
391  switch( meObjectKind )
392  {
393  case SgaObjKind::SvDraw:
394  {
395  if( !bLazy )
396  {
397  if( !mpGraphicObject )
398  {
399  Graphic aGraphic;
400 
401  if( mpTheme->GetGraphic( mnObjectPos, aGraphic ) )
402  mpGraphicObject.reset(new GraphicObject( aGraphic ));
403  }
404 
405  if( !mxModelStream.is() )
406  {
407  mxModelStream = new SotStorageStream( "" );
408  mxModelStream->SetBufferSize( 16348 );
409 
412  else
413  mxModelStream->Seek( 0 );
414  }
415  }
416  }
417  break;
418 
420  case SgaObjKind::Bitmap:
421  case SgaObjKind::Inet:
422  case SgaObjKind::Sound:
423  {
424  if( !mpURL )
425  {
426  mpURL.reset(new INetURLObject);
427 
428  if( !mpTheme->GetURL( mnObjectPos, *mpURL ) )
429  {
430  mpURL.reset();
431  }
432  }
433 
435  {
436  Graphic aGraphic;
437 
438  if( mpTheme->GetGraphic( mnObjectPos, aGraphic ) )
439  mpGraphicObject.reset(new GraphicObject( aGraphic ));
440  }
441  }
442  break;
443 
444  default:
445  OSL_FAIL( "GalleryTransferable::GalleryTransferable: invalid object type" );
446  break;
447  }
448 }
449 
451 {
453  {
454  AddFormat( SotClipboardFormatId::DRAWING );
455  AddFormat( SotClipboardFormatId::SVXB );
456  AddFormat( SotClipboardFormatId::GDIMETAFILE );
457  AddFormat( SotClipboardFormatId::BITMAP );
458  }
459  else
460  {
461  if( mpURL )
462  AddFormat( SotClipboardFormatId::SIMPLE_FILE );
463 
464  if( mpGraphicObject )
465  {
466  AddFormat( SotClipboardFormatId::SVXB );
467 
468  if( mpGraphicObject->GetType() == GraphicType::GdiMetafile )
469  {
470  AddFormat( SotClipboardFormatId::GDIMETAFILE );
471  AddFormat( SotClipboardFormatId::BITMAP );
472  }
473  else
474  {
475  AddFormat( SotClipboardFormatId::BITMAP );
476  AddFormat( SotClipboardFormatId::GDIMETAFILE );
477  }
478  }
479  }
480 }
481 
482 bool GalleryTransferable::GetData( const datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
483 {
484  SotClipboardFormatId nFormat = SotExchange::GetFormat( rFlavor );
485  bool bRet = false;
486 
487  InitData( false );
488 
489  if( ( SotClipboardFormatId::DRAWING == nFormat ) && ( SgaObjKind::SvDraw == meObjectKind ) )
490  {
491  bRet = ( mxModelStream.is() && SetObject( mxModelStream.get(), 0, rFlavor ) );
492  }
493  else if( ( SotClipboardFormatId::SIMPLE_FILE == nFormat ) && mpURL )
494  {
495  bRet = SetString( mpURL->GetMainURL( INetURLObject::DecodeMechanism::NONE ), rFlavor );
496  }
497  else if( ( SotClipboardFormatId::SVXB == nFormat ) && mpGraphicObject )
498  {
499  bRet = SetGraphic( mpGraphicObject->GetGraphic() );
500  }
501  else if( ( SotClipboardFormatId::GDIMETAFILE == nFormat ) && mpGraphicObject )
502  {
503  bRet = SetGDIMetaFile( mpGraphicObject->GetGraphic().GetGDIMetaFile() );
504  }
505  else if( ( SotClipboardFormatId::BITMAP == nFormat ) && mpGraphicObject )
506  {
507  bRet = SetBitmapEx( mpGraphicObject->GetGraphic().GetBitmapEx(), rFlavor );
508  }
509 
510  return bRet;
511 }
512 
514  sal_uInt32, const datatransfer::DataFlavor& )
515 {
516  bool bRet = false;
517 
518  if( pUserObject )
519  {
520  rxOStm->WriteStream( *static_cast< SotStorageStream* >( pUserObject ) );
521  bRet = ( rxOStm->GetError() == ERRCODE_NONE );
522  }
523 
524  return bRet;
525 }
526 
528 {
529  mpTheme->SetDragging( false );
530  mpTheme->SetDragPos( 0 );
531  if ( nDropAction )
532  {
533  vcl::Window *pFocusWindow = Application::GetFocusWindow();
534  if ( pFocusWindow )
535  pFocusWindow->GrabFocusToDocument();
536  }
537 }
538 
540 {
542  mpGraphicObject.reset();
543  mpURL.reset();
544 }
545 
546 void GalleryTransferable::StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions )
547 {
549 
550  if( mpTheme->GetURL( mnObjectPos, aURL ) && ( aURL.GetProtocol() != INetProtocol::NotValid ) )
551  {
552  mpTheme->SetDragging( true );
554  TransferableHelper::StartDrag( pWindow, nDragSourceActions );
555  }
556 }
557 
558 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool is() const
User data of a drawing object, e.g.
Definition: svdobj.hxx:204
bool SvxDrawingLayerImport(SdrModel *pModel, const uno::Reference< io::XInputStream > &xInputStream, const Reference< lang::XComponent > &xComponent)
Definition: xmlexport.cxx:143
OUString GetReducedString(const INetURLObject &rURL, sal_Int32 nMaxLen)
Definition: galmisc.cxx:170
URL aURL
void Update(sal_Int32 nVal, sal_Int32 nMaxVal)
Definition: galmisc.cxx:368
virtual bool WriteObject(tools::SvRef< SotStorageStream > &rxOStm, void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor) override
Definition: galmisc.cxx:513
ErrCode ImportGraphic(Graphic &rGraphic, const INetURLObject &rPath, sal_uInt16 nFormat=GRFILTER_FORMAT_DONTKNOW, sal_uInt16 *pDeterminedFormat=nullptr, GraphicFilterImportFlags nImportFlags=GraphicFilterImportFlags::NONE)
bool SetBitmapEx(const BitmapEx &rBitmap, const css::datatransfer::DataFlavor &rFlavor)
std::unique_ptr< INetURLObject > mpURL
Definition: galmisc.hxx:144
bool insertNewContent(const OUString &rContentType, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues, Content &rNewContent)
bool CreateIMapGraphic(const FmFormModel &rModel, Graphic &rGraphic, ImageMap &rImageMap)
Definition: galmisc.cxx:138
signed char sal_Int8
css::uno::Any getPropertyValue(const OUString &rPropertyName)
OUString GetImportFormatName(sal_uInt16 nFormat)
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:773
size_t GetObjCount() const
Definition: svdpage.cxx:767
sal_uInt64 Seek(sal_uInt64 nPos)
virtual void ObjectReleased() override
Definition: galmisc.cxx:539
bool FileExists(const INetURLObject &rURL)
Definition: galmisc.cxx:217
OUString GetLastName(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
void Read(SvStream &rStmToRead)
Definition: codec.cxx:84
bool SetObject(void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor)
bool CreateDir(const INetURLObject &rURL)
Definition: galmisc.cxx:245
void AddFormat(SotClipboardFormatId nFormat)
SAL_DLLPRIVATE void SetDragging(bool bSet)
Definition: galtheme.hxx:141
sal_uInt16 sal_Unicode
SAL_DLLPRIVATE bool GetURL(sal_uInt32 nPos, INetURLObject &rURL)
Definition: galtheme.cxx:1042
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
sal_uInt32 const mnObjectPos
Definition: galmisc.hxx:141
int nCount
SotClipboardFormatId
Bitmap GetBitmap(o3tl::optional< Color > xTransparentReplaceColor=o3tl::optional< Color >()) const
css::uno::Reference< css::lang::XComponent > xComponent
virtual void AddSupportedFormats() override
Definition: galmisc.cxx:450
tools::SvRef< SotStorageStream > mxModelStream
Definition: galmisc.hxx:142
bool SetGraphic(const Graphic &rGraphic)
SAL_DLLPRIVATE void SetDragPos(sal_uInt32 nPos)
Definition: galtheme.hxx:151
T * get() const
OUString getFSysPath(FSysStyle eStyle, sal_Unicode *pDelimiter=nullptr) const
GalleryTransferable(GalleryTheme *pTheme, sal_uInt32 nObjectPos, bool bLazy)
Definition: galmisc.cxx:376
GalleryGraphicImportRet GalleryGraphicImport(const INetURLObject &rURL, Graphic &rGraphic, OUString &rFilterName)
Definition: galmisc.cxx:69
int i
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1917
GalleryProgress(const GraphicFilter *pFilter=nullptr)
Definition: galmisc.cxx:335
GalleryTheme * mpTheme
Definition: galmisc.hxx:139
BitmapEx GalleryResGetBitmapEx(const OUString &rId)
Definition: galmisc.cxx:58
void GrabFocusToDocument()
#define GRFILTER_FORMAT_DONTKNOW
void StartDrag(vcl::Window *pWindow, sal_Int8 nDragSourceActions)
virtual bool GetData(const css::datatransfer::DataFlavor &rFlavor, const OUString &rDestDoc) override
Definition: galmisc.cxx:482
constexpr::Color COL_LIGHTMAGENTA(0xFF, 0x00, 0xFF)
GalleryGraphicImportRet
Definition: galmisc.hxx:68
bool GetGraphic(sal_uInt32 nPos, Graphic &rGraphic)
Definition: galtheme.cxx:731
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:79
sal_Int16 nVersion
bool IsTransparent() const
bool KillFile(const INetURLObject &rURL)
Definition: galmisc.cxx:306
Abstract DrawObject.
Definition: svdobj.hxx:312
bool GallerySvDrawImport(SvStream &rIStm, SdrModel &rModel)
Definition: galmisc.cxx:94
#define GALLERY_PROGRESS_RANGE
Definition: galmisc.hxx:73
std::unique_ptr< GraphicObject > mpGraphicObject
Definition: galmisc.hxx:143
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool CopyFile(const INetURLObject &rSrcURL, const INetURLObject &rDstURL)
Definition: galmisc.cxx:280
SAL_DLLPRIVATE bool GetModelStream(sal_uInt32 nPos, tools::SvRef< SotStorageStream > const &rModelStreamRef)
Definition: galtheme.cxx:957
static SotClipboardFormatId GetFormat(const css::datatransfer::DataFlavor &rFlavor)
static vcl::Window * GetFocusWindow()
Reference< XMultiServiceFactory > getProcessServiceFactory()
void SetDefaultMetric(MapUnit eNewMetric)
css::uno::Reference< css::awt::XProgressBar > mxProgressBar
Definition: galmisc.hxx:121
void StartDrag(vcl::Window *pWindow, sal_Int8 nDragSourceActions)
Definition: galmisc.cxx:546
#define ERRCODE_NONE
sal_uInt16 GetId() const
Definition: svdobj.hxx:220
OUString aName
INetProtocol GetProtocol() const
SdrObjUserData * GetUserData(sal_uInt16 nNum) const
Definition: svdobj.cxx:2636
Reference< XComponentContext > getProcessComponentContext()
sal_uInt16 GetUserDataCount() const
Definition: svdobj.cxx:2630
virtual ~GalleryTransferable() override
Definition: galmisc.cxx:385
void InitData(bool bLazy)
Definition: galmisc.cxx:389
static bool IsCoded(SvStream &rStm, sal_uInt32 &rVersion)
Definition: codec.cxx:36
static GraphicFilter & GetGraphicFilter()
css::uno::Any executeCommand(const OUString &rCommandName, const css::uno::Any &rCommandArgument)
OUString GetSvDrawStreamNameFromURL(const INetURLObject &rSvDrawObjURL)
Definition: galmisc.cxx:204
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:314
sal_Int32 getTokenCount(const OString &rIn, sal_Char cTok)
void Download(const Link< void *, void > &aLink=Link< void *, void >())
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:366
SgaObjKind const meObjectKind
Definition: galmisc.hxx:140
SdrInventor GetInventor() const
Definition: svdobj.hxx:219
bool SetString(const OUString &rString, const css::datatransfer::DataFlavor &rFlavor)
#define ID_IMAPINFO
Definition: galmisc.hxx:64
sal_uInt16 GetPageCount() const
Definition: svdmodel.cxx:1929
bool SetGDIMetaFile(const GDIMetaFile &rMtf)
bool removeSegment(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true)
virtual void DragFinished(sal_Int8 nDropAction) override
Definition: galmisc.cxx:527