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
ed584a8b
Kaydet (Commit)
ed584a8b
authored
Ara 15, 2003
tarafından
Mikhail Voitenko
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#112923# let object work on unix
üst
2ea6cb57
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
58 deletions
+92
-58
oleembobj.hxx
embeddedobj/source/inc/oleembobj.hxx
+3
-2
olecomponent.cxx
embeddedobj/source/msole/olecomponent.cxx
+8
-27
oleembed.cxx
embeddedobj/source/msole/oleembed.cxx
+50
-16
olemisc.cxx
embeddedobj/source/msole/olemisc.cxx
+19
-9
olepersist.cxx
embeddedobj/source/msole/olepersist.cxx
+0
-0
olevisual.cxx
embeddedobj/source/msole/olevisual.cxx
+12
-4
No files found.
embeddedobj/source/inc/oleembobj.hxx
Dosyayı görüntüle @
ed584a8b
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: oleembobj.hxx,v $
*
* $Revision: 1.
8
$
* $Revision: 1.
9
$
*
* last change: $Author: mav $ $Date: 2003-12-
09 15:09:3
0 $
* last change: $Author: mav $ $Date: 2003-12-
15 15:37:4
0 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -205,6 +205,7 @@ public:
sal_Bool
OnShowWindow_Impl
(
sal_Bool
bShow
);
void
CreateOleComponent_Impl
(
OleComponent
*
pOleComponent
=
NULL
);
void
CreateOleComponentAndLoad_Impl
(
OleComponent
*
pOleComponent
=
NULL
);
void
SetObjectIsLink_Impl
(
sal_Bool
bIsLink
)
{
m_bIsLink
=
bIsLink
;
}
...
...
embeddedobj/source/msole/olecomponent.cxx
Dosyayı görüntüle @
ed584a8b
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: olecomponent.cxx,v $
*
* $Revision: 1.1
5
$
* $Revision: 1.1
6
$
*
* last change: $Author: mav $ $Date: 2003-12-15 1
3:10:01
$
* last change: $Author: mav $ $Date: 2003-12-15 1
5:37:42
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -98,13 +98,15 @@ using namespace ::com::sun::star;
#define MAX_ENUM_ELE 20
#define FORMATS_NUM 3
const
sal_Int32
n_ConstBufferSize
=
32000
;
sal_Bool
ConvertBufferToFormat
(
void
*
pBuf
,
sal_uInt32
nBufSize
,
const
::
rtl
::
OUString
&
aFormatShortName
,
uno
::
Any
&
aResult
);
void
copyInputToOutput_Impl
(
const
uno
::
Reference
<
io
::
XInputStream
>&
aIn
,
const
uno
::
Reference
<
io
::
XOutputStream
>&
aOut
);
typedef
::
std
::
vector
<
FORMATETC
*
>
FormatEtcList
;
FORMATETC
pFormatTemplates
[
FORMATS_NUM
]
=
{
...
...
@@ -325,29 +327,6 @@ sal_Bool OleComponentNative_Impl::GraphicalFlavor( const datatransfer::DataFlavo
return
sal_False
;
}
//-----------------------------------------------
// TODO: probably later such a common function can be moved
// to a separate helper library.
void
copyInputToOutput_Impl
(
const
uno
::
Reference
<
io
::
XInputStream
>&
aIn
,
const
uno
::
Reference
<
io
::
XOutputStream
>&
aOut
)
{
sal_Int32
nRead
;
uno
::
Sequence
<
sal_Int8
>
aSequence
(
n_ConstBufferSize
);
do
{
nRead
=
aIn
->
readBytes
(
aSequence
,
n_ConstBufferSize
);
if
(
nRead
<
n_ConstBufferSize
)
{
uno
::
Sequence
<
sal_Int8
>
aTempBuf
(
aSequence
.
getConstArray
(),
nRead
);
aOut
->
writeBytes
(
aTempBuf
);
}
else
aOut
->
writeBytes
(
aSequence
);
}
while
(
nRead
==
n_ConstBufferSize
);
}
//-----------------------------------------------
sal_Bool
KillFile
(
const
::
rtl
::
OUString
&
aURL
,
const
uno
::
Reference
<
lang
::
XMultiServiceFactory
>&
xFactory
)
{
...
...
@@ -579,6 +558,8 @@ FORMATETC* OleComponentNative_Impl::GetSupportedFormatForAspect( sal_uInt32 nReq
//----------------------------------------------
void
OleComponent
::
Dispose
()
{
CloseObject
();
if
(
m_pOleWrapClientSite
)
{
m_pOleWrapClientSite
->
disconnectOleComponent
();
...
...
embeddedobj/source/msole/oleembed.cxx
Dosyayı görüntüle @
ed584a8b
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: oleembed.cxx,v $
*
* $Revision: 1.
3
$
* $Revision: 1.
4
$
*
* last change: $Author: mav $ $Date: 2003-12-1
2 12:50:5
2 $
* last change: $Author: mav $ $Date: 2003-12-1
5 15:37:4
2 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -147,25 +147,30 @@ void SAL_CALL OleEmbeddedObject::changeState( sal_Int32 nNewState )
if
(
m_nObjectState
==
nNewState
)
return
;
if
(
!
m_pOleComponent
)
throw
uno
::
RuntimeException
();
#ifdef WNT
// TODO: additional verbs can be a problem, since nobody knows how the object
// will behave after activation
if
(
nNewState
==
embed
::
EmbedStates
::
EMBED_LOADED
)
{
// This means just closing of the current object
SaveObject_Impl
();
m_pOleComponent
->
CloseObject
();
// If component can not be closed the object stays in loaded state
// and it holds reference to "incomplete" component
// If the object is switched to running state later
// the component will become "complete"
GetRidOfComponent
(
sal_False
);
}
else
else
if
(
nNewState
==
embed
::
EmbedStates
::
EMBED_RUNNING
||
nNewState
==
embed
::
EmbedStates
::
EMBED_ACTIVE
)
{
if
(
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_LOADED
)
{
// if the target object is in loaded state and a different state is specified
// as a new one the object first must be switched to running state.
// the component can exist already in nonrunning state
// it can be created during loading to detect type of object
CreateOleComponentAndLoad_Impl
(
m_pOleComponent
);
m_pOleComponent
->
RunObject
();
m_nObjectState
=
embed
::
EmbedStates
::
EMBED_RUNNING
;
if
(
m_nObjectState
==
nNewState
)
...
...
@@ -185,9 +190,13 @@ void SAL_CALL OleEmbeddedObject::changeState( sal_Int32 nNewState )
}
else
{
OSL_ENSURE
(
sal_False
,
"Unreachable code executed!"
);
throw
embed
::
UnreachableStateException
(
);
}
}
else
#endif
throw
embed
::
UnreachableStateException
();
}
//----------------------------------------------
...
...
@@ -203,18 +212,22 @@ uno::Sequence< sal_Int32 > SAL_CALL OleEmbeddedObject::getReachableStates()
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"The object has no persistence!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
if
(
!
m_pOleComponent
)
throw
uno
::
RuntimeException
();
#ifdef WNT
if
(
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_LOADED
)
{
// the list of supported verbs can be retrieved only when object is in running state
throw
embed
::
NeedsRunningStateException
();
// TODO:
}
if
(
!
m_pOleComponent
)
throw
uno
::
RuntimeException
();
// the list of states can only be guessed based on standard verbs,
// since there is no way to detect what additional verbs do
return
GetReachableStatesList_Impl
(
m_pOleComponent
->
GetVerbList
()
);
#else
return
uno
::
Sequence
<
sal_Int32
>
();
#endif
}
//----------------------------------------------
...
...
@@ -250,19 +263,26 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"The object has no persistence!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
if
(
!
m_pOleComponent
)
throw
uno
::
RuntimeException
();
#ifdef WNT
if
(
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_LOADED
)
{
// if the target object is in loaded state
// it must be switched to running state to execute verb
// the component can exist already in noncomplete state
// it can be created during loading
CreateOleComponentAndLoad_Impl
(
m_pOleComponent
);
m_pOleComponent
->
RunObject
();
m_nObjectState
=
embed
::
EmbedStates
::
EMBED_RUNNING
;
}
if
(
!
m_pOleComponent
)
throw
uno
::
RuntimeException
();
m_pOleComponent
->
ExecuteVerb
(
nVerbID
);
#else
throw
embed
::
UnreachableStateException
();
#endif
}
//----------------------------------------------
...
...
@@ -277,14 +297,20 @@ uno::Sequence< embed::VerbDescr > SAL_CALL OleEmbeddedObject::getSupportedVerbs(
if
(
m_nObjectState
==
-
1
)
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"The object has no persistence!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
#ifdef WNT
if
(
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_LOADED
)
{
// the list of supported verbs can be retrieved only when object is in running state
throw
embed
::
NeedsRunningStateException
();
// TODO:
}
if
(
!
m_pOleComponent
)
throw
uno
::
RuntimeException
();
return
m_pOleComponent
->
GetVerbList
();
#else
return
uno
::
Sequence
<
embed
::
VerbDescr
>
();
#endif
}
//----------------------------------------------
...
...
@@ -377,6 +403,14 @@ sal_Int64 SAL_CALL OleEmbeddedObject::getStatus( sal_Int64 nAspect )
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"The object must be in running state!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
#ifdef WNT
if
(
!
m_pOleComponent
)
throw
uno
::
RuntimeException
();
return
m_pOleComponent
->
GetMiscStatus
(
nAspect
);
#else
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"Illegal call!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
#endif
}
embeddedobj/source/msole/olemisc.cxx
Dosyayı görüntüle @
ed584a8b
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: olemisc.cxx,v $
*
* $Revision: 1.
9
$
* $Revision: 1.
10
$
*
* last change: $Author: mav $ $Date: 2003-12-1
2 12:50:52
$
* last change: $Author: mav $ $Date: 2003-12-1
5 15:37:43
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -138,20 +138,30 @@ OleEmbeddedObject::~OleEmbeddedObject()
//------------------------------------------------------
void
OleEmbeddedObject
::
GetRidOfComponent
()
{
#ifdef WNT
if
(
m_pOleComponent
)
{
if
(
m_nObjectState
!=
embed
::
EmbedStates
::
EMBED_LOADED
)
{
SaveObject_Impl
();
m_pOleComponent
->
CloseObject
();
}
m_pOleComponent
->
removeCloseListener
(
m_xClosePreventer
);
m_pOleComponent
->
close
(
sal_True
);
try
{
m_pOleComponent
->
close
(
sal_False
);
}
catch
(
uno
::
Exception
&
)
{
// TODO: there should be a special listener to wait for component closing
// and to notify object, may be object itself can be such a listener
m_pOleComponent
->
addCloseListener
(
m_xClosePreventer
);
throw
;
}
m_pOleComponent
->
disconnectEmbeddedObject
();
m_pOleComponent
->
release
();
m_pOleComponent
=
NULL
;
}
#endif
}
//------------------------------------------------------
...
...
@@ -165,6 +175,8 @@ void OleEmbeddedObject::Dispose()
m_pInterfaceContainer
=
NULL
;
}
m_bDisposed
=
true
;
if
(
m_pOleComponent
)
GetRidOfComponent
();
...
...
@@ -183,8 +195,6 @@ void OleEmbeddedObject::Dispose()
}
m_xParentStorage
=
uno
::
Reference
<
embed
::
XStorage
>
();
m_bDisposed
=
true
;
}
//------------------------------------------------------
...
...
@@ -229,7 +239,7 @@ uno::Reference< util::XCloseable > SAL_CALL OleEmbeddedObject::getComponent()
if
(
m_nObjectState
==
-
1
||
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_LOADED
)
{
// the object is still not
loaded
// the object is still not
running
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"The object is not running!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
}
...
...
embeddedobj/source/msole/olepersist.cxx
Dosyayı görüntüle @
ed584a8b
This diff is collapsed.
Click to expand it.
embeddedobj/source/msole/olevisual.cxx
Dosyayı görüntüle @
ed584a8b
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: olevisual.cxx,v $
*
* $Revision: 1.
1
$
* $Revision: 1.
2
$
*
* last change: $Author: mav $ $Date: 2003-1
1-13 17:01:1
4 $
* last change: $Author: mav $ $Date: 2003-1
2-15 15:37:4
4 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -96,11 +96,15 @@ void SAL_CALL OleEmbeddedObject::setVisAreaSize( sal_Int64 nAspect, const awt::S
if
(
m_nObjectState
==
-
1
||
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_LOADED
)
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"The own object has no model!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
#ifdef WNT
if
(
!
m_pOleComponent
)
throw
uno
::
RuntimeException
();
m_pOleComponent
->
SetExtent
(
aSize
,
nAspect
);
// will throw an exception in case of failure
#else
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"Illegal call!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
#endif
}
awt
::
Size
SAL_CALL
OleEmbeddedObject
::
getVisAreaSize
(
sal_Int64
nAspect
)
...
...
@@ -116,11 +120,15 @@ awt::Size SAL_CALL OleEmbeddedObject::getVisAreaSize( sal_Int64 nAspect )
if
(
m_nObjectState
==
-
1
||
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_LOADED
)
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"The own object has no model!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
#ifdef WNT
if
(
!
m_pOleComponent
)
throw
uno
::
RuntimeException
();
return
m_pOleComponent
->
GetExtent
(
nAspect
);
// will throw an exception in case of failure
#else
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"Illegal call!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
#endif
}
// Probably will be removed!!!
...
...
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