docinf.cxx (d119d52d) docinf.cxx (45fd3b9a)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 11 unchanged lines hidden (view full) ---

20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_sfx2.hxx"
26
27#include <sfx2/docinf.hxx>
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 11 unchanged lines hidden (view full) ---

20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_sfx2.hxx"
26
27#include <sfx2/docinf.hxx>
28
29#include <com/sun/star/beans/PropertyAttribute.hpp>
30#include <com/sun/star/beans/XPropertySet.hpp>
31#include <com/sun/star/beans/XPropertyContainer.hpp>
32#include <com/sun/star/document/XDocumentProperties.hpp>
33#include <com/sun/star/uno/Exception.hpp>
28#include <com/sun/star/beans/PropertyAttribute.hpp>
29#include <com/sun/star/beans/XPropertySet.hpp>
30#include <com/sun/star/beans/XPropertyContainer.hpp>
31#include <com/sun/star/document/XDocumentProperties.hpp>
32#include <com/sun/star/uno/Exception.hpp>
34
35#include <rtl/ustring.hxx>
36#include <tools/debug.hxx>
37#include <comphelper/string.hxx>
38#include <sot/storage.hxx>
39#include <vcl/gdimtf.hxx>
33#include <rtl/ustring.hxx>
34#include <tools/debug.hxx>
35#include <comphelper/string.hxx>
36#include <sot/storage.hxx>
37#include <vcl/gdimtf.hxx>
40
38#include <vcl/dibtools.hxx>
41#include "oleprops.hxx"
42
43// ============================================================================
44
45// stream names
46#define STREAM_SUMMARYINFO "\005SummaryInformation"
47#define STREAM_DOCSUMMARYINFO "\005DocumentSummaryInformation"
48

--- 232 unchanged lines hidden (view full) ---

281
282uno::Sequence<sal_uInt8> SFX2_DLLPUBLIC convertMetaFile(GDIMetaFile* i_pThumb)
283{
284 if (i_pThumb) {
285 BitmapEx aBitmap;
286 SvMemoryStream aStream;
287// magic value 160 taken from GraphicHelper::getThumbnailFormatFromGDI_Impl()
288 if( i_pThumb->CreateThumbnail( 160, aBitmap ) ) {
39#include "oleprops.hxx"
40
41// ============================================================================
42
43// stream names
44#define STREAM_SUMMARYINFO "\005SummaryInformation"
45#define STREAM_DOCSUMMARYINFO "\005DocumentSummaryInformation"
46

--- 232 unchanged lines hidden (view full) ---

279
280uno::Sequence<sal_uInt8> SFX2_DLLPUBLIC convertMetaFile(GDIMetaFile* i_pThumb)
281{
282 if (i_pThumb) {
283 BitmapEx aBitmap;
284 SvMemoryStream aStream;
285// magic value 160 taken from GraphicHelper::getThumbnailFormatFromGDI_Impl()
286 if( i_pThumb->CreateThumbnail( 160, aBitmap ) ) {
289 aBitmap.GetBitmap().Write( aStream, sal_False, sal_False );
287 WriteDIB(aBitmap.GetBitmap(), aStream, false, false);
290// uno::Sequence<sal_uInt8> aSeq(aStream.GetSize()); // WRONG
291 aStream.Seek(STREAM_SEEK_TO_END);
292 uno::Sequence<sal_uInt8> aSeq(aStream.Tell());
293 const sal_uInt8* pBlob(
294 static_cast<const sal_uInt8*>(aStream.GetData()));
295 for (sal_Int32 j = 0; j < aSeq.getLength(); ++j) {
296 aSeq[j] = pBlob[j];
297 }
298 return aSeq;
299 }
300 }
301 return uno::Sequence<sal_uInt8>();
302}
303
304} // namespace sfx2
305
288// uno::Sequence<sal_uInt8> aSeq(aStream.GetSize()); // WRONG
289 aStream.Seek(STREAM_SEEK_TO_END);
290 uno::Sequence<sal_uInt8> aSeq(aStream.Tell());
291 const sal_uInt8* pBlob(
292 static_cast<const sal_uInt8*>(aStream.GetData()));
293 for (sal_Int32 j = 0; j < aSeq.getLength(); ++j) {
294 aSeq[j] = pBlob[j];
295 }
296 return aSeq;
297 }
298 }
299 return uno::Sequence<sal_uInt8>();
300}
301
302} // namespace sfx2
303