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
b378e754
Kaydet (Commit)
b378e754
authored
Agu 16, 2013
tarafından
Cao Cuong Ngo
Kaydeden (comit)
Cédric Bosdonnat
Eyl 02, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
CMIS: fix file saving issue
Change-Id: I60cccb841fea5ce493f004c73ecf50468019f860
üst
19b76cc2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
102 deletions
+62
-102
mediadescriptor.cxx
comphelper/source/misc/mediadescriptor.cxx
+4
-1
docfile.cxx
sfx2/source/doc/docfile.cxx
+2
-3
cmis_content.cxx
ucb/source/ucp/cmis/cmis_content.cxx
+53
-95
cmis_url.cxx
ucb/source/ucp/cmis/cmis_url.cxx
+3
-3
No files found.
comphelper/source/misc/mediadescriptor.cxx
Dosyayı görüntüle @
b378e754
...
@@ -484,7 +484,10 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile )
...
@@ -484,7 +484,10 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile )
throw
css
::
uno
::
Exception
(
"Found no URL."
,
throw
css
::
uno
::
Exception
(
"Found no URL."
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
return
impl_openStreamWithURL
(
removeFragment
(
sURL
),
bLockFile
);
// Parse URL! Only the main part has to be used further. E.g. a jumpmark can make trouble
// We need to keep the full URL with Mark to store the Object ID
// in CMIS UCB
return
impl_openStreamWithURL
(
sURL
,
bLockFile
);
}
}
catch
(
const
css
::
uno
::
Exception
&
ex
)
catch
(
const
css
::
uno
::
Exception
&
ex
)
{
{
...
...
sfx2/source/doc/docfile.cxx
Dosyayı görüntüle @
b378e754
...
@@ -2479,7 +2479,7 @@ void SfxMedium::Init_Impl()
...
@@ -2479,7 +2479,7 @@ void SfxMedium::Init_Impl()
{
{
if
(
aUrl
.
HasMark
()
)
if
(
aUrl
.
HasMark
()
)
{
{
pImp
->
m_aLogicName
=
aUrl
.
GetURLNoMark
(
INetURLObject
::
NO_DECODE
);
// keep the Mark to store the Document ID
GetItemSet
()
->
Put
(
SfxStringItem
(
SID_JUMPMARK
,
aUrl
.
GetMark
()
)
);
GetItemSet
()
->
Put
(
SfxStringItem
(
SID_JUMPMARK
,
aUrl
.
GetMark
()
)
);
}
}
...
@@ -2994,8 +2994,7 @@ const INetURLObject& SfxMedium::GetURLObject() const
...
@@ -2994,8 +2994,7 @@ const INetURLObject& SfxMedium::GetURLObject() const
if
(
!
pImp
->
m_pURLObj
)
if
(
!
pImp
->
m_pURLObj
)
{
{
pImp
->
m_pURLObj
=
new
INetURLObject
(
pImp
->
m_aLogicName
);
pImp
->
m_pURLObj
=
new
INetURLObject
(
pImp
->
m_aLogicName
);
if
(
pImp
->
m_pURLObj
->
HasMark
())
// keep the Mark to store the Document ID
*
pImp
->
m_pURLObj
=
INetURLObject
(
pImp
->
m_aLogicName
).
GetURLNoMark
();
}
}
return
*
pImp
->
m_pURLObj
;
return
*
pImp
->
m_pURLObj
;
...
...
ucb/source/ucp/cmis/cmis_content.cxx
Dosyayı görüntüle @
b378e754
...
@@ -412,7 +412,18 @@ namespace cmis
...
@@ -412,7 +412,18 @@ namespace cmis
{
{
if
(
!
m_pObject
.
get
()
)
if
(
!
m_pObject
.
get
()
)
{
{
if
(
!
m_sObjectPath
.
isEmpty
(
)
)
if
(
!
m_sObjectId
.
isEmpty
(
)
)
{
try
{
m_pObject
=
getSession
(
xEnv
)
->
getObject
(
OUSTR_TO_STDSTR
(
m_sObjectId
)
);
}
catch
(
const
libcmis
::
Exception
&
)
{
throw
libcmis
::
Exception
(
"Object not found"
);
}
}
else
if
(
!
m_sObjectPath
.
isEmpty
(
)
)
{
{
try
try
{
{
...
@@ -435,7 +446,7 @@ namespace cmis
...
@@ -435,7 +446,7 @@ namespace cmis
{
{
vector
<
libcmis
::
ObjectPtr
>
children
=
pParentFolder
->
getChildren
(
);
vector
<
libcmis
::
ObjectPtr
>
children
=
pParentFolder
->
getChildren
(
);
for
(
vector
<
libcmis
::
ObjectPtr
>::
iterator
it
=
children
.
begin
(
);
for
(
vector
<
libcmis
::
ObjectPtr
>::
iterator
it
=
children
.
begin
(
);
it
!=
children
.
end
()
&&
!
m_pObject
;
++
it
)
it
!=
children
.
end
()
&&
!
m_pObject
;
++
it
)
{
{
if
(
(
*
it
)
->
getName
(
)
==
sName
)
if
(
(
*
it
)
->
getName
(
)
==
sName
)
m_pObject
=
*
it
;
m_pObject
=
*
it
;
...
@@ -446,8 +457,6 @@ namespace cmis
...
@@ -446,8 +457,6 @@ namespace cmis
throw
libcmis
::
Exception
(
"Object not found"
);
throw
libcmis
::
Exception
(
"Object not found"
);
}
}
}
}
else
if
(
!
m_sObjectId
.
isEmpty
(
)
)
m_pObject
=
getSession
(
xEnv
)
->
getObject
(
OUSTR_TO_STDSTR
(
m_sObjectId
)
);
else
else
{
{
m_pObject
=
getSession
(
xEnv
)
->
getRootFolder
(
);
m_pObject
=
getSession
(
xEnv
)
->
getRootFolder
(
);
...
@@ -464,7 +473,9 @@ namespace cmis
...
@@ -464,7 +473,9 @@ namespace cmis
bool
bIsFolder
=
false
;
bool
bIsFolder
=
false
;
try
try
{
{
bIsFolder
=
getObject
(
xEnv
)
->
getBaseType
(
)
==
"cmis:folder"
;
libcmis
::
ObjectPtr
obj
=
getObject
(
xEnv
);
if
(
obj
)
bIsFolder
=
obj
->
getBaseType
(
)
==
"cmis:folder"
;
}
}
catch
(
const
libcmis
::
Exception
&
e
)
catch
(
const
libcmis
::
Exception
&
e
)
{
{
...
@@ -536,7 +547,9 @@ namespace cmis
...
@@ -536,7 +547,9 @@ namespace cmis
{
{
try
try
{
{
xRow
->
appendBoolean
(
rProp
,
getObject
(
xEnv
)
->
getBaseType
(
)
==
"cmis:document"
);
libcmis
::
ObjectPtr
obj
=
getObject
(
xEnv
);
if
(
obj
)
xRow
->
appendBoolean
(
rProp
,
obj
->
getBaseType
(
)
==
"cmis:document"
);
}
}
catch
(
const
libcmis
::
Exception
&
)
catch
(
const
libcmis
::
Exception
&
)
{
{
...
@@ -550,7 +563,11 @@ namespace cmis
...
@@ -550,7 +563,11 @@ namespace cmis
{
{
try
try
{
{
xRow
->
appendBoolean
(
rProp
,
getObject
(
xEnv
)
->
getBaseType
(
)
==
"cmis:folder"
);
libcmis
::
ObjectPtr
obj
=
getObject
(
xEnv
);
if
(
obj
)
xRow
->
appendBoolean
(
rProp
,
obj
->
getBaseType
(
)
==
"cmis:folder"
);
else
xRow
->
appendBoolean
(
rProp
,
sal_False
);
}
}
catch
(
const
libcmis
::
Exception
&
)
catch
(
const
libcmis
::
Exception
&
)
{
{
...
@@ -630,20 +647,7 @@ namespace cmis
...
@@ -630,20 +647,7 @@ namespace cmis
else
if
(
rProp
.
Name
==
"TitleOnServer"
)
else
if
(
rProp
.
Name
==
"TitleOnServer"
)
{
{
string
path
;
string
path
;
try
xRow
->
appendString
(
rProp
,
m_sObjectPath
);
{
vector
<
string
>
paths
=
getObject
(
xEnv
)
->
getPaths
(
);
if
(
!
paths
.
empty
(
)
)
path
=
paths
.
front
(
);
else
path
=
getObject
(
xEnv
)
->
getName
(
);
xRow
->
appendString
(
rProp
,
STD_TO_OUSTR
(
path
)
);
}
catch
(
const
libcmis
::
Exception
&
)
{
xRow
->
appendVoid
(
rProp
);
}
}
}
else
if
(
rProp
.
Name
==
"IsReadOnly"
)
else
if
(
rProp
.
Name
==
"IsReadOnly"
)
{
{
...
@@ -1151,41 +1155,30 @@ namespace cmis
...
@@ -1151,41 +1155,30 @@ namespace cmis
if
(
pFolder
!=
NULL
)
if
(
pFolder
!=
NULL
)
{
{
libcmis
::
ObjectPtr
object
;
libcmis
::
ObjectPtr
object
;
string
newPath
;
map
<
string
,
libcmis
::
PropertyPtr
>::
iterator
it
=
m_pObjectProps
.
find
(
"cmis:name"
)
;
if
(
m_sObjectId
.
isEmpty
(
)
)
if
(
it
==
m_pObjectProps
.
end
(
)
)
{
{
map
<
string
,
libcmis
::
PropertyPtr
>::
iterator
it
=
m_pObjectProps
.
find
(
"cmis:name"
);
ucbhelper
::
cancelCommandExecution
(
uno
::
makeAny
if
(
it
==
m_pObjectProps
.
end
(
)
)
(
uno
::
RuntimeException
(
"Missing name property"
,
{
static_cast
<
cppu
::
OWeakObject
*
>
(
this
)
)
),
ucbhelper
::
cancelCommandExecution
(
uno
::
makeAny
xEnv
);
(
uno
::
RuntimeException
(
"Missing name property"
,
static_cast
<
cppu
::
OWeakObject
*
>
(
this
)
)
),
xEnv
);
}
string
newName
=
it
->
second
->
getStrings
(
).
front
(
);
newPath
=
pFolder
->
getPath
(
);
if
(
newPath
[
newPath
.
size
(
)
-
1
]
!=
'/'
)
newPath
+=
"/"
;
newPath
+=
newName
;
try
{
object
=
getSession
(
xEnv
)
->
getObjectByPath
(
newPath
);
sNewPath
=
STD_TO_OUSTR
(
newPath
);
}
catch
(
const
libcmis
::
Exception
&
)
{
// Nothing matched the path
}
}
}
else
string
newName
=
it
->
second
->
getStrings
(
).
front
(
);
string
newPath
=
OUSTR_TO_STDSTR
(
m_sObjectPath
);
if
(
!
newPath
.
empty
(
)
&&
newPath
[
newPath
.
size
(
)
-
1
]
!=
'/'
)
newPath
+=
"/"
;
newPath
+=
newName
;
try
try
{
{
object
=
getSession
(
xEnv
)
->
getObject
(
OUSTR_TO_STDSTR
(
m_sObjectId
)
);
if
(
!
m_sObjectId
.
isEmpty
(
)
)
object
=
getSession
(
xEnv
)
->
getObject
(
OUSTR_TO_STDSTR
(
m_sObjectId
)
);
else
object
=
getSession
(
xEnv
)
->
getObjectByPath
(
newPath
);
sNewPath
=
STD_TO_OUSTR
(
newPath
);
}
}
catch
(
libcmis
::
Exception
&
)
catch
(
const
libcmis
::
Exception
&
)
{
{
//
Continue
//
Nothing matched the path
}
}
if
(
NULL
!=
object
.
get
(
)
)
if
(
NULL
!=
object
.
get
(
)
)
...
@@ -1272,7 +1265,8 @@ namespace cmis
...
@@ -1272,7 +1265,8 @@ namespace cmis
m_pObjectType
.
reset
(
);
m_pObjectType
.
reset
(
);
m_pObjectProps
.
clear
(
);
m_pObjectProps
.
clear
(
);
m_bTransient
=
false
;
m_bTransient
=
false
;
uno
::
Reference
<
ucb
::
XContentIdentifier
>
xId
(
new
::
ucbhelper
::
ContentIdentifier
(
m_sURL
));
m_xIdentifier
=
xId
;
inserted
();
inserted
();
}
}
}
}
...
@@ -1545,54 +1539,18 @@ namespace cmis
...
@@ -1545,54 +1539,18 @@ namespace cmis
OUString
sRet
;
OUString
sRet
;
SAL_INFO
(
"cmisucp"
,
"Content::getParentURL()"
);
SAL_INFO
(
"cmisucp"
,
"Content::getParentURL()"
);
OUString
parentUrl
=
OUString
(
"/"
);
string
parentPath
;
if
(
m_sObjectPath
==
"/"
)
try
return
parentUrl
;
{
libcmis
::
ObjectPtr
pObj
=
getObject
(
uno
::
Reference
<
ucb
::
XCommandEnvironment
>
()
);
libcmis
::
Document
*
document
=
dynamic_cast
<
libcmis
::
Document
*
>
(
pObj
.
get
(
)
);
if
(
NULL
!=
document
)
{
vector
<
boost
::
shared_ptr
<
libcmis
::
Folder
>
>
parents
=
document
->
getParents
(
);
if
(
!
parents
.
empty
(
)
)
parentPath
=
parents
.
front
(
)
->
getPath
(
);
}
else
{
libcmis
::
Folder
*
folder
=
dynamic_cast
<
libcmis
::
Folder
*
>
(
pObj
.
get
(
)
);
if
(
NULL
!=
folder
)
{
libcmis
::
FolderPtr
parentFolder
=
folder
->
getFolderParent
(
);
if
(
NULL
!=
parentFolder
)
parentPath
=
parentFolder
->
getPath
(
);
}
}
}
catch
(
const
libcmis
::
Exception
&
)
{
// We may have an exception if we don't have the rights to
// get the parents
}
if
(
!
parentPath
.
empty
()
)
{
URL
aUrl
(
m_sURL
);
aUrl
.
setObjectPath
(
STD_TO_OUSTR
(
parentPath
)
);
sRet
=
aUrl
.
asString
(
);
}
else
else
{
{
INetURLObject
aUrl
(
m_sURL
);
INetURLObject
aParentUrl
(
m_sURL
);
if
(
aUrl
.
getSegmentCount
(
)
>
0
)
string
sName
=
OUSTR_TO_STDSTR
(
aParentUrl
.
getName
(
INetURLObject
::
LAST_SEGMENT
,
true
,
INetURLObject
::
DECODE_WITH_CHARSET
)
);
{
aParentUrl
.
removeSegment
(
);
URL
aCmisUrl
(
m_sURL
);
return
aParentUrl
.
GetMainURL
(
INetURLObject
::
NO_DECODE
);
aUrl
.
removeSegment
(
);
aCmisUrl
.
setObjectPath
(
aUrl
.
GetURLPath
(
INetURLObject
::
DECODE_WITH_CHARSET
)
);
sRet
=
aCmisUrl
.
asString
(
);
}
}
}
return
sRet
;
return
parentUrl
;
}
}
XTYPEPROVIDER_COMMON_IMPL
(
Content
);
XTYPEPROVIDER_COMMON_IMPL
(
Content
);
...
...
ucb/source/ucp/cmis/cmis_url.cxx
Dosyayı görüntüle @
b378e754
...
@@ -35,8 +35,8 @@ namespace cmis
...
@@ -35,8 +35,8 @@ namespace cmis
m_sPath
=
aUrl
.
GetURLPath
(
INetURLObject
::
DECODE_WITH_CHARSET
);
m_sPath
=
aUrl
.
GetURLPath
(
INetURLObject
::
DECODE_WITH_CHARSET
);
m_sId
=
aUrl
.
GetMark
(
INetURLObject
::
DECODE_WITH_CHARSET
);
m_sId
=
aUrl
.
GetMark
(
INetURLObject
::
DECODE_WITH_CHARSET
);
if
(
!
m_sId
.
isEmpty
(
)
)
if
(
m_sPath
==
"/"
&&
m_sBindingUrl
.
indexOf
(
"google"
)
!=
-
1
)
m_s
Path
=
OUString
(
)
;
m_s
Id
=
"root"
;
}
}
OUString
&
URL
::
getObjectPath
(
)
OUString
&
URL
::
getObjectPath
(
)
...
@@ -103,7 +103,7 @@ namespace cmis
...
@@ -103,7 +103,7 @@ namespace cmis
while
(
nPos
!=
-
1
);
while
(
nPos
!=
-
1
);
sUrl
+=
sEncodedPath
;
sUrl
+=
sEncodedPath
;
}
}
else
if
(
!
m_sId
.
isEmpty
(
)
)
if
(
!
m_sId
.
isEmpty
(
)
)
{
{
sUrl
+=
"#"
+
rtl
::
Uri
::
encode
(
m_sId
,
sUrl
+=
"#"
+
rtl
::
Uri
::
encode
(
m_sId
,
rtl_UriCharClassRelSegment
,
rtl_UriCharClassRelSegment
,
...
...
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