Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
be8bbd29
Kaydet (Commit)
be8bbd29
authored
Eki 05, 2017
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:flatten (clang-cl, embeddedobj)
Change-Id: Ic870347b3dc0ce6b7ad223c47a36b54843a26613
üst
3d1b53a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
85 deletions
+81
-85
olecomponent.cxx
embeddedobj/source/msole/olecomponent.cxx
+9
-11
xdialogcreator.cxx
embeddedobj/source/msole/xdialogcreator.cxx
+72
-74
No files found.
embeddedobj/source/msole/olecomponent.cxx
Dosyayı görüntüle @
be8bbd29
...
...
@@ -1563,19 +1563,17 @@ uno::Any SAL_CALL OleComponent::getTransferData( const datatransfer::DataFlavor&
uno
::
Reference
<
io
::
XOutputStream
>
xTempOutStream
=
xTempFileStream
->
getOutputStream
();
uno
::
Reference
<
io
::
XInputStream
>
xTempInStream
=
xTempFileStream
->
getInputStream
();
if
(
xTempOutStream
.
is
()
&&
xTempInStream
.
is
()
)
{
OSL_ENSURE
(
m_pUnoOleObject
,
"Unexpected object absence!"
);
if
(
!
m_pUnoOleObject
)
throw
uno
::
RuntimeException
();
if
(
!
(
xTempOutStream
.
is
()
&&
xTempInStream
.
is
())
)
throw
io
::
IOException
();
// TODO:
m_pUnoOleObject
->
StoreObjectToStream
(
xTempOutStream
);
OSL_ENSURE
(
m_pUnoOleObject
,
"Unexpected object absence!"
);
if
(
!
m_pUnoOleObject
)
throw
uno
::
RuntimeException
();
xTempOutStream
->
closeOutput
();
xTempOutStream
.
clear
();
}
else
throw
io
::
IOException
();
// TODO:
m_pUnoOleObject
->
StoreObjectToStream
(
xTempOutStream
);
xTempOutStream
->
closeOutput
();
xTempOutStream
.
clear
();
aResult
<<=
xTempInStream
;
}
...
...
embeddedobj/source/msole/xdialogcreator.cxx
Dosyayı görüntüle @
be8bbd29
...
...
@@ -176,92 +176,90 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia
uTemp
=
pInsertFct
(
&
io
);
if
(
OLEUI_OK
==
uTemp
)
if
(
OLEUI_OK
!=
uTemp
)
throw
ucb
::
CommandAbortedException
();
if
(
io
.
dwFlags
&
IOF_SELECTCREATENEW
)
{
if
(
io
.
dwFlags
&
IOF_SELECTCREATENEW
)
{
uno
::
Reference
<
embed
::
XEmbeddedObjectCreator
>
xEmbCreator
=
embed
::
EmbeddedObjectCreator
::
create
(
comphelper
::
getComponentContext
(
m_xFactory
)
);
uno
::
Sequence
<
sal_Int8
>
aClassID
=
MimeConfigurationHelper
::
GetSequenceClassID
(
io
.
clsid
.
Data1
,
io
.
clsid
.
Data2
,
io
.
clsid
.
Data3
,
io
.
clsid
.
Data4
[
0
],
io
.
clsid
.
Data4
[
1
],
io
.
clsid
.
Data4
[
2
],
io
.
clsid
.
Data4
[
3
],
io
.
clsid
.
Data4
[
4
],
io
.
clsid
.
Data4
[
5
],
io
.
clsid
.
Data4
[
6
],
io
.
clsid
.
Data4
[
7
]
);
aClassID
=
GetRelatedInternalID_Impl
(
aClassID
);
//TODO: retrieve ClassName
aObjectInfo
.
Object
.
set
(
xEmbCreator
->
createInstanceInitNew
(
aClassID
,
OUString
(),
xStorage
,
sEntName
,
aObjArgs
),
uno
::
UNO_QUERY
);
}
else
{
OUString
aFileName
=
OStringToOUString
(
OString
(
szFile
),
osl_getThreadTextEncoding
()
);
OUString
aFileURL
;
if
(
osl
::
FileBase
::
getFileURLFromSystemPath
(
aFileName
,
aFileURL
)
!=
osl
::
FileBase
::
E_None
)
throw
uno
::
RuntimeException
();
uno
::
Reference
<
embed
::
XEmbeddedObjectCreator
>
xEmbCreator
=
embed
::
EmbeddedObjectCreator
::
create
(
comphelper
::
getComponentContext
(
m_xFactory
)
);
uno
::
Sequence
<
sal_Int8
>
aClassID
=
MimeConfigurationHelper
::
GetSequenceClassID
(
io
.
clsid
.
Data1
,
io
.
clsid
.
Data2
,
io
.
clsid
.
Data3
,
io
.
clsid
.
Data4
[
0
],
io
.
clsid
.
Data4
[
1
],
io
.
clsid
.
Data4
[
2
],
io
.
clsid
.
Data4
[
3
],
io
.
clsid
.
Data4
[
4
],
io
.
clsid
.
Data4
[
5
],
io
.
clsid
.
Data4
[
6
],
io
.
clsid
.
Data4
[
7
]
);
aClassID
=
GetRelatedInternalID_Impl
(
aClassID
);
//TODO: retrieve ClassName
aObjectInfo
.
Object
.
set
(
xEmbCreator
->
createInstanceInitNew
(
aClassID
,
OUString
(),
xStorage
,
sEntName
,
aObjArgs
),
uno
::
UNO_QUERY
);
}
else
{
OUString
aFileName
=
OStringToOUString
(
OString
(
szFile
),
osl_getThreadTextEncoding
()
);
OUString
aFileURL
;
if
(
osl
::
FileBase
::
getFileURLFromSystemPath
(
aFileName
,
aFileURL
)
!=
osl
::
FileBase
::
E_None
)
throw
uno
::
RuntimeException
();
uno
::
Sequence
<
beans
::
PropertyValue
>
aMediaDescr
(
1
);
aMediaDescr
[
0
].
Name
=
"URL"
;
aMediaDescr
[
0
].
Value
<<=
aFileURL
;
uno
::
Sequence
<
beans
::
PropertyValue
>
aMediaDescr
(
1
);
aMediaDescr
[
0
].
Name
=
"URL"
;
aMediaDescr
[
0
].
Value
<<=
aFileURL
;
// TODO: use config helper for type detection
uno
::
Reference
<
embed
::
XEmbeddedObjectCreator
>
xEmbCreator
;
::
comphelper
::
MimeConfigurationHelper
aHelper
(
comphelper
::
getComponentContext
(
m_xFactory
)
);
// TODO: use config helper for type detection
uno
::
Reference
<
embed
::
XEmbeddedObjectCreator
>
xEmbCreator
;
::
comphelper
::
MimeConfigurationHelper
aHelper
(
comphelper
::
getComponentContext
(
m_xFactory
)
);
if
(
aHelper
.
AddFilterNameCheckOwnFile
(
aMediaDescr
)
)
xEmbCreator
=
embed
::
EmbeddedObjectCreator
::
create
(
comphelper
::
getComponentContext
(
m_xFactory
)
);
else
xEmbCreator
=
embed
::
OLEEmbeddedObjectFactory
::
create
(
comphelper
::
getComponentContext
(
m_xFactory
)
);
if
(
aHelper
.
AddFilterNameCheckOwnFile
(
aMediaDescr
)
)
xEmbCreator
=
embed
::
EmbeddedObjectCreator
::
create
(
comphelper
::
getComponentContext
(
m_xFactory
)
);
else
xEmbCreator
=
embed
::
OLEEmbeddedObjectFactory
::
create
(
comphelper
::
getComponentContext
(
m_xFactory
)
);
if
(
!
xEmbCreator
.
is
()
)
throw
uno
::
RuntimeException
();
if
(
!
xEmbCreator
.
is
()
)
throw
uno
::
RuntimeException
();
aObjectInfo
.
Object
.
set
(
xEmbCreator
->
createInstanceInitFromMediaDescriptor
(
xStorage
,
sEntName
,
aMediaDescr
,
aObjArgs
),
uno
::
UNO_QUERY
);
}
aObjectInfo
.
Object
.
set
(
xEmbCreator
->
createInstanceInitFromMediaDescriptor
(
xStorage
,
sEntName
,
aMediaDescr
,
aObjArgs
),
uno
::
UNO_QUERY
);
}
if
(
(
io
.
dwFlags
&
IOF_CHECKDISPLAYASICON
)
&&
io
.
hMetaPict
!=
nullptr
)
if
(
(
io
.
dwFlags
&
IOF_CHECKDISPLAYASICON
)
&&
io
.
hMetaPict
!=
nullptr
)
{
METAFILEPICT
*
pMF
=
static_cast
<
METAFILEPICT
*>
(
GlobalLock
(
io
.
hMetaPict
));
if
(
pMF
)
{
METAFILEPICT
*
pMF
=
static_cast
<
METAFILEPICT
*>
(
GlobalLock
(
io
.
hMetaPict
));
if
(
pMF
)
sal_uInt32
nBufSize
=
GetMetaFileBitsEx
(
pMF
->
hMF
,
0
,
nullptr
);
uno
::
Sequence
<
sal_Int8
>
aMetafile
(
nBufSize
+
22
);
sal_Int8
*
pBuf
=
aMetafile
.
getArray
();
*
reinterpret_cast
<
long
*>
(
pBuf
)
=
0x9ac6cdd7L
;
*
reinterpret_cast
<
short
*>
(
pBuf
+
6
)
=
(
SHORT
)
0
;
*
reinterpret_cast
<
short
*>
(
pBuf
+
8
)
=
(
SHORT
)
0
;
*
reinterpret_cast
<
short
*>
(
pBuf
+
10
)
=
(
SHORT
)
pMF
->
xExt
;
*
reinterpret_cast
<
short
*>
(
pBuf
+
12
)
=
(
SHORT
)
pMF
->
yExt
;
*
reinterpret_cast
<
short
*>
(
pBuf
+
14
)
=
(
USHORT
)
2540
;
if
(
nBufSize
&&
nBufSize
==
GetMetaFileBitsEx
(
pMF
->
hMF
,
nBufSize
,
pBuf
+
22
)
)
{
sal_uInt32
nBufSize
=
GetMetaFileBitsEx
(
pMF
->
hMF
,
0
,
nullptr
);
uno
::
Sequence
<
sal_Int8
>
aMetafile
(
nBufSize
+
22
);
sal_Int8
*
pBuf
=
aMetafile
.
getArray
();
*
reinterpret_cast
<
long
*>
(
pBuf
)
=
0x9ac6cdd7L
;
*
reinterpret_cast
<
short
*>
(
pBuf
+
6
)
=
(
SHORT
)
0
;
*
reinterpret_cast
<
short
*>
(
pBuf
+
8
)
=
(
SHORT
)
0
;
*
reinterpret_cast
<
short
*>
(
pBuf
+
10
)
=
(
SHORT
)
pMF
->
xExt
;
*
reinterpret_cast
<
short
*>
(
pBuf
+
12
)
=
(
SHORT
)
pMF
->
yExt
;
*
reinterpret_cast
<
short
*>
(
pBuf
+
14
)
=
(
USHORT
)
2540
;
if
(
nBufSize
&&
nBufSize
==
GetMetaFileBitsEx
(
pMF
->
hMF
,
nBufSize
,
pBuf
+
22
)
)
{
datatransfer
::
DataFlavor
aFlavor
(
"application/x-openoffice-wmf;windows_formatname=
\"
Image WMF
\"
"
,
"Image WMF"
,
cppu
::
UnoType
<
uno
::
Sequence
<
sal_Int8
>>::
get
()
);
aObjectInfo
.
Options
.
realloc
(
2
);
aObjectInfo
.
Options
[
0
].
Name
=
"Icon"
;
aObjectInfo
.
Options
[
0
].
Value
<<=
aMetafile
;
aObjectInfo
.
Options
[
1
].
Name
=
"IconFormat"
;
aObjectInfo
.
Options
[
1
].
Value
<<=
aFlavor
;
}
GlobalUnlock
(
io
.
hMetaPict
);
datatransfer
::
DataFlavor
aFlavor
(
"application/x-openoffice-wmf;windows_formatname=
\"
Image WMF
\"
"
,
"Image WMF"
,
cppu
::
UnoType
<
uno
::
Sequence
<
sal_Int8
>>::
get
()
);
aObjectInfo
.
Options
.
realloc
(
2
);
aObjectInfo
.
Options
[
0
].
Name
=
"Icon"
;
aObjectInfo
.
Options
[
0
].
Value
<<=
aMetafile
;
aObjectInfo
.
Options
[
1
].
Name
=
"IconFormat"
;
aObjectInfo
.
Options
[
1
].
Value
<<=
aFlavor
;
}
GlobalUnlock
(
io
.
hMetaPict
);
}
}
else
throw
ucb
::
CommandAbortedException
();
OSL_ENSURE
(
aObjectInfo
.
Object
.
is
(),
"No object was created!"
);
if
(
!
aObjectInfo
.
Object
.
is
()
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment