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
c37f4bb9
Kaydet (Commit)
c37f4bb9
authored
Kas 04, 2003
tarafından
Mikhail Voitenko
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#112739# add breakLink method
üst
c606cf90
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
46 deletions
+112
-46
miscobj.cxx
embeddedobj/source/commonembedding/miscobj.cxx
+4
-2
persistence.cxx
embeddedobj/source/commonembedding/persistence.cxx
+92
-35
commonembobj.hxx
embeddedobj/source/inc/commonembobj.hxx
+11
-3
EmbedContApp.java
embeddedobj/test/Container1/EmbedContApp.java
+5
-6
No files found.
embeddedobj/source/commonembedding/miscobj.cxx
Dosyayı görüntüle @
c37f4bb9
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: miscobj.cxx,v $
*
* $Revision: 1.
1
$
* $Revision: 1.
2
$
*
* last change: $Author: mav $ $Date: 2003-1
0-27 12:57:2
9 $
* last change: $Author: mav $ $Date: 2003-1
1-04 14:30:1
9 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -236,6 +236,7 @@ uno::Any SAL_CALL OCommonEmbeddedObject::queryInterface( const uno::Type& rType
static_cast
<
embed
::
XEmbeddedObject
*
>
(
this
),
static_cast
<
embed
::
XVisualObject
*
>
(
this
),
static_cast
<
embed
::
XEmbedPersist
*
>
(
this
),
static_cast
<
embed
::
XLinkageSupport
*
>
(
this
),
static_cast
<
embed
::
XClassifiedObject
*
>
(
this
),
static_cast
<
embed
::
XComponentSupplier
*
>
(
this
),
static_cast
<
document
::
XEventBroadcaster
*
>
(
this
)
);
...
...
@@ -277,6 +278,7 @@ uno::Sequence< uno::Type > SAL_CALL OCommonEmbeddedObject::getTypes()
::
getCppuType
(
(
const
uno
::
Reference
<
embed
::
XEmbeddedObject
>*
)
NULL
),
::
getCppuType
(
(
const
uno
::
Reference
<
embed
::
XVisualObject
>*
)
NULL
),
::
getCppuType
(
(
const
uno
::
Reference
<
embed
::
XEmbedPersist
>*
)
NULL
),
::
getCppuType
(
(
const
uno
::
Reference
<
embed
::
XLinkageSupport
>*
)
NULL
),
::
getCppuType
(
(
const
uno
::
Reference
<
embed
::
XClassifiedObject
>*
)
NULL
),
::
getCppuType
(
(
const
uno
::
Reference
<
embed
::
XComponentSupplier
>*
)
NULL
),
::
getCppuType
(
(
const
uno
::
Reference
<
document
::
XEventBroadcaster
>*
)
NULL
)
);
...
...
embeddedobj/source/commonembedding/persistence.cxx
Dosyayı görüntüle @
c37f4bb9
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: persistence.cxx,v $
*
* $Revision: 1.
1
$
* $Revision: 1.
2
$
*
* last change: $Author: mav $ $Date: 2003-1
0-27 12:57:2
9 $
* last change: $Author: mav $ $Date: 2003-1
1-04 14:30:1
9 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -499,7 +499,7 @@ uno::Reference< frame::XModel > OCommonEmbeddedObject::CreateTempDocFromLink_Imp
}
//------------------------------------------------------
void
SAL_CALL
OCommonEmbeddedObject
::
setPersistentEntry
(
sal_Bool
SAL_CALL
OCommonEmbeddedObject
::
setPersistentEntry
(
const
uno
::
Reference
<
embed
::
XStorage
>&
xStorage
,
const
::
rtl
::
OUString
&
sEntName
,
sal_Int32
nEntryConnectionMode
,
...
...
@@ -593,36 +593,9 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry(
if
(
nEntryConnectionMode
==
embed
::
EntryInitModes
::
ENTRY_NO_INIT
)
{
// the document just already changed its storage to store to
// the links to OOo documents will ignore this call and return false
if
(
m_bIsLink
)
{
// for linked object it means that it becomes embedded object
// the document must switch it's persistence also
// the document is a new embedded object so it must be marked as modified
uno
::
Reference
<
frame
::
XModel
>
xDocument
=
CreateTempDocFromLink_Impl
();
uno
::
Reference
<
util
::
XModifiable
>
xModif
(
m_pDocHolder
->
GetDocument
(),
uno
::
UNO_QUERY
);
if
(
!
xModif
.
is
()
)
throw
uno
::
RuntimeException
();
try
{
xModif
->
setModified
(
sal_True
);
}
catch
(
uno
::
Exception
&
)
{}
m_pDocHolder
->
SetDocument
(
xDocument
,
m_bReadOnly
);
OSL_ENSURE
(
m_pDocHolder
->
GetDocument
().
is
(),
"If document cant be created, an exception must be thrown!
\n
"
);
if
(
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_LOADED
)
m_nObjectState
=
embed
::
EmbedStates
::
EMBED_RUNNING
;
else
if
(
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_ACTIVE
)
m_pDocHolder
->
Show
();
m_bIsLink
=
sal_False
;
m_aLinkFilterName
=
::
rtl
::
OUString
();
m_aLinkURL
=
::
rtl
::
OUString
();
}
return
sal_False
;
}
else
if
(
nEntryConnectionMode
==
embed
::
EntryInitModes
::
ENTRY_TRUNCATE_INIT
)
{
...
...
@@ -648,6 +621,8 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry(
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
),
3
);
}
return
sal_True
;
}
//------------------------------------------------------
...
...
@@ -961,6 +936,88 @@ void SAL_CALL OCommonEmbeddedObject::reload(
// use meaningfull part of lArguments
}
//------------------------------------------------------
void
SAL_CALL
OCommonEmbeddedObject
::
breakLink
(
const
uno
::
Reference
<
embed
::
XStorage
>&
xStorage
,
const
::
rtl
::
OUString
&
sEntName
)
throw
(
lang
::
IllegalArgumentException
,
embed
::
WrongStateException
,
io
::
IOException
,
uno
::
Exception
,
uno
::
RuntimeException
)
{
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
if
(
m_bDisposed
)
throw
lang
::
DisposedException
();
// TODO
if
(
!
xStorage
.
is
()
)
throw
lang
::
IllegalArgumentException
(
::
rtl
::
OUString
::
createFromAscii
(
"No parent storage is provided!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
),
1
);
if
(
!
sEntName
.
getLength
()
)
throw
lang
::
IllegalArgumentException
(
::
rtl
::
OUString
::
createFromAscii
(
"Empty element name is provided!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
),
2
);
if
(
!
m_bIsLink
||
m_nObjectState
==
-
1
)
{
// it must be a linked initialized object
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"The object is not a valid linked object!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
}
if
(
m_bWaitSaveCompleted
)
throw
embed
::
WrongStateException
(
::
rtl
::
OUString
::
createFromAscii
(
"The object waits for saveCompleted() call!
\n
"
),
uno
::
Reference
<
uno
::
XInterface
>
(
reinterpret_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
)
);
uno
::
Reference
<
container
::
XNameAccess
>
xNameAccess
(
xStorage
,
uno
::
UNO_QUERY
);
if
(
!
xNameAccess
.
is
()
)
throw
uno
::
RuntimeException
();
//TODO
// detect entry existence
sal_Bool
bElExists
=
xNameAccess
->
hasByName
(
sEntName
);
m_bReadOnly
=
sal_False
;
sal_Int32
nStorageMode
=
embed
::
ElementModes
::
ELEMENT_READWRITE
;
m_xObjectStorage
=
xStorage
->
openStorageElement
(
sEntName
,
nStorageMode
);
m_xParentStorage
=
xStorage
;
m_aEntryName
=
sEntName
;
// the object should be based on the storage ??? TODO
if
(
bElExists
&&
!
xStorage
->
isStorageElement
(
sEntName
)
)
throw
io
::
IOException
();
// TODO access denied
// for linked object it means that it becomes embedded object
// the document must switch it's persistence also
// the document is a new embedded object so it must be marked as modified
uno
::
Reference
<
frame
::
XModel
>
xDocument
=
CreateTempDocFromLink_Impl
();
uno
::
Reference
<
util
::
XModifiable
>
xModif
(
m_pDocHolder
->
GetDocument
(),
uno
::
UNO_QUERY
);
if
(
!
xModif
.
is
()
)
throw
uno
::
RuntimeException
();
try
{
xModif
->
setModified
(
sal_True
);
}
catch
(
uno
::
Exception
&
)
{}
m_pDocHolder
->
SetDocument
(
xDocument
,
m_bReadOnly
);
OSL_ENSURE
(
m_pDocHolder
->
GetDocument
().
is
(),
"If document cant be created, an exception must be thrown!
\n
"
);
if
(
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_LOADED
)
m_nObjectState
=
embed
::
EmbedStates
::
EMBED_RUNNING
;
else
if
(
m_nObjectState
==
embed
::
EmbedStates
::
EMBED_ACTIVE
)
m_pDocHolder
->
Show
();
m_bIsLink
=
sal_False
;
m_aLinkFilterName
=
::
rtl
::
OUString
();
m_aLinkURL
=
::
rtl
::
OUString
();
}
//------------------------------------------------------
sal_Bool
SAL_CALL
OCommonEmbeddedObject
::
isLink
()
throw
(
embed
::
WrongStateException
,
...
...
@@ -980,9 +1037,9 @@ sal_Bool SAL_CALL OCommonEmbeddedObject::isLink()
//------------------------------------------------------
::
rtl
::
OUString
SAL_CALL
OCommonEmbeddedObject
::
getLinkURL
()
throw
(
::
com
::
sun
::
star
::
embed
::
WrongStateException
,
::
com
::
sun
::
star
::
uno
::
Exception
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
throw
(
embed
::
WrongStateException
,
uno
::
Exception
,
uno
::
RuntimeException
)
{
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
if
(
m_bDisposed
)
...
...
embeddedobj/source/inc/commonembobj.hxx
Dosyayı görüntüle @
c37f4bb9
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: commonembobj.hxx,v $
*
* $Revision: 1.
1
$
* $Revision: 1.
2
$
*
* last change: $Author: mav $ $Date: 2003-1
0-27 13:00:38
$
* last change: $Author: mav $ $Date: 2003-1
1-04 14:30:20
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -326,7 +326,7 @@ public:
// XEmbedPersist
virtual
void
SAL_CALL
setPersistentEntry
(
virtual
sal_Bool
SAL_CALL
setPersistentEntry
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
embed
::
XStorage
>&
xStorage
,
const
::
rtl
::
OUString
&
sEntName
,
sal_Int32
nEntryConnectionMode
,
...
...
@@ -387,6 +387,14 @@ public:
// XLinkageSupport
virtual
void
SAL_CALL
breakLink
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
embed
::
XStorage
>&
xStorage
,
const
::
rtl
::
OUString
&
sEntName
)
throw
(
::
com
::
sun
::
star
::
lang
::
IllegalArgumentException
,
::
com
::
sun
::
star
::
embed
::
WrongStateException
,
::
com
::
sun
::
star
::
io
::
IOException
,
::
com
::
sun
::
star
::
uno
::
Exception
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
sal_Bool
SAL_CALL
isLink
()
throw
(
::
com
::
sun
::
star
::
embed
::
WrongStateException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
embeddedobj/test/Container1/EmbedContApp.java
Dosyayı görüntüle @
c37f4bb9
...
...
@@ -617,18 +617,17 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
if
(
xNameAccess
!=
null
&&
xNameAccess
.
hasByName
(
"LinkName"
)
)
m_xStorage
.
removeElement
(
"LinkName"
);
X
EmbedPersist
xPersist
=
(
XEmbedPersist
)
UnoRuntime
.
queryInterface
(
XEmbedPersis
t
.
class
,
m_xEmbedObj
);
if
(
x
Persist
!=
null
)
X
LinkageSupport
xLinkage
=
(
XLinkageSupport
)
UnoRuntime
.
queryInterface
(
XLinkageSuppor
t
.
class
,
m_xEmbedObj
);
if
(
x
Linkage
!=
null
)
{
PropertyValue
[]
pEmp
=
new
PropertyValue
[
0
];
xPersist
.
setPersistentEntry
(
m_xStorage
,
"EmbedSub"
,
EntryInitModes
.
ENTRY_NO_INIT
,
pEmp
);
xLinkage
.
breakLink
(
m_xStorage
,
"EmbedSub"
);
m_bLinkObj
=
false
;
m_aLinkURI
=
null
;
}
else
JOptionPane
.
showMessageDialog
(
m_aFrame
,
"No X
EmbedPersis
t in ConvertLink... !"
,
"No X
LinkageSuppor
t in ConvertLink... !"
,
"Error:"
,
JOptionPane
.
ERROR_MESSAGE
);
}
...
...
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