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
cd5e167b
Kaydet (Commit)
cd5e167b
authored
May 06, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Turn StorageMode into a scoped enum
Change-Id: I481c153815fff793e9334153d863f26982b879cb
üst
edaa4785
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
21 deletions
+31
-21
storage.hxx
include/sot/storage.hxx
+18
-8
storage.cxx
sot/source/sdstor/storage.cxx
+12
-12
ww8par.cxx
sw/source/filter/ww8/ww8par.cxx
+1
-1
No files found.
include/sot/storage.hxx
Dosyayı görüntüle @
cd5e167b
...
...
@@ -25,6 +25,7 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <o3tl/typed_flags_set.hxx>
#include <sot/object.hxx>
#include <sot/factory.hxx>
#include <tools/stream.hxx>
...
...
@@ -32,10 +33,19 @@
#include <sot/storinfo.hxx>
#include <sot/sotdllapi.h>
#define STORAGE_TRANSACTED 0x04
#define STORAGE_DISKSPANNED_MODE 0x80
#define STORAGE_CREATE_UNPACKED 0x44
typedef
short
StorageMode
;
enum
class
StorageMode
{
Default
=
0
,
Transacted
=
0x04
,
DiskspannedMode
=
0x80
,
CreateUnpacked
=
0x44
};
namespace
o3tl
{
template
<>
struct
typed_flags
<
StorageMode
>:
is_typed_flags
<
StorageMode
,
0xC4
>
{};
}
class
SvStorage
;
...
...
@@ -58,7 +68,7 @@ protected:
public
:
SotStorageStream
(
const
OUString
&
,
StreamMode
=
STREAM_STD_READWRITE
,
StorageMode
=
0
);
StorageMode
=
StorageMode
::
Default
);
SotStorageStream
(
BaseStorageStream
*
pStm
);
SotStorageStream
();
...
...
@@ -113,10 +123,10 @@ protected:
public
:
SotStorage
(
const
OUString
&
,
StreamMode
=
STREAM_STD_READWRITE
,
StorageMode
=
0
);
StorageMode
=
StorageMode
::
Default
);
SotStorage
(
bool
bUCBStorage
,
const
OUString
&
,
StreamMode
=
STREAM_STD_READWRITE
,
StorageMode
=
0
);
StorageMode
=
StorageMode
::
Default
);
SotStorage
(
BaseStorage
*
);
SotStorage
(
SvStream
&
rStm
);
SotStorage
(
bool
bUCBStorage
,
SvStream
&
rStm
);
...
...
@@ -181,7 +191,7 @@ public:
// more or less a Parent-Child relationship
SotStorageStream
*
OpenSotStream
(
const
OUString
&
rEleName
,
StreamMode
=
STREAM_STD_READWRITE
,
StorageMode
=
0
);
StorageMode
=
StorageMode
::
Default
);
SotStorage
*
OpenSotStorage
(
const
OUString
&
rEleName
,
StreamMode
=
STREAM_STD_READWRITE
,
bool
transacted
=
true
);
...
...
sot/source/sdstor/storage.cxx
Dosyayı görüntüle @
cd5e167b
...
...
@@ -89,7 +89,7 @@ SotStorageStream::SotStorageStream( const OUString & rName, StreamMode nMode,
else
bIsWritable
=
false
;
DBG_ASSERT
(
!
nStorageMode
,
"StorageModes ignored"
);
DBG_ASSERT
(
nStorageMode
==
StorageMode
::
Default
,
"StorageModes ignored"
);
}
SotStorageStream
::
SotStorageStream
(
BaseStorageStream
*
pStm
)
...
...
@@ -368,7 +368,7 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage
}
// a new unpacked storage should be created
if
(
nStorageMode
==
S
TORAGE_CREATE_UNPACKED
)
if
(
nStorageMode
==
S
torageMode
::
CreateUnpacked
)
{
// don't open stream readwrite, content provider may not support this !
OUString
aURL
=
UCBStorage
::
CreateLinkFile
(
m_aName
);
...
...
@@ -403,35 +403,35 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage
if
(
!
(
UCBStorage
::
GetLinkedFile
(
*
m_pStorStm
).
isEmpty
())
)
{
// detect special unpacked storages
m_pOwnStg
=
new
UCBStorage
(
*
m_pStorStm
,
(
nStorageMode
&
STORAGE_TRANSACTED
)
==
0
);
m_pOwnStg
=
new
UCBStorage
(
*
m_pStorStm
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
m_bDelStm
=
true
;
}
else
{
// detect special disk spanned storages
if
(
UCBStorage
::
IsDiskSpannedFile
(
m_pStorStm
)
)
nStorageMode
|=
S
TORAGE_DISKSPANNED_MODE
;
nStorageMode
|=
S
torageMode
::
DiskspannedMode
;
// UCBStorage always works directly on the UCB content, so discard the stream first
DELETEZ
(
m_pStorStm
);
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
(
nStorageMode
&
STORAGE_TRANSACTED
)
==
0
);
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
}
}
else
{
// OLEStorage can be opened with a stream
m_pOwnStg
=
new
Storage
(
*
m_pStorStm
,
(
nStorageMode
&
STORAGE_TRANSACTED
)
==
0
);
m_pOwnStg
=
new
Storage
(
*
m_pStorStm
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
m_bDelStm
=
true
;
}
}
else
if
(
bForceUCBStorage
)
{
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
(
nStorageMode
&
STORAGE_TRANSACTED
)
==
0
);
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
SetError
(
ERRCODE_IO_NOTSUPPORTED
);
}
else
{
m_pOwnStg
=
new
Storage
(
m_aName
,
nMode
,
(
nStorageMode
&
STORAGE_TRANSACTED
)
==
0
);
m_pOwnStg
=
new
Storage
(
m_aName
,
nMode
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
SetError
(
ERRCODE_IO_NOTSUPPORTED
);
}
}
...
...
@@ -440,9 +440,9 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage
{
// temporary storage
if
(
bForceUCBStorage
)
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
(
nStorageMode
&
STORAGE_TRANSACTED
)
==
0
);
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
else
m_pOwnStg
=
new
Storage
(
m_aName
,
nMode
,
(
nStorageMode
&
STORAGE_TRANSACTED
)
==
0
);
m_pOwnStg
=
new
Storage
(
m_aName
,
nMode
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
m_aName
=
m_pOwnStg
->
GetName
();
}
...
...
@@ -691,7 +691,7 @@ SotStorageStream * SotStorage::OpenSotStream( const OUString & rEleName,
StreamMode
nMode
,
StorageMode
nStorageMode
)
{
DBG_ASSERT
(
!
nStorageMode
,
"StorageModes ignored"
);
DBG_ASSERT
(
nStorageMode
==
StorageMode
::
Default
,
"StorageModes ignored"
);
SotStorageStream
*
pStm
=
NULL
;
DBG_ASSERT
(
Owner
(),
"must be owner"
);
if
(
m_pOwnStg
)
...
...
@@ -701,7 +701,7 @@ SotStorageStream * SotStorage::OpenSotStream( const OUString & rEleName,
nMode
|=
StreamMode
::
SHARE_DENYALL
;
ErrCode
nE
=
m_pOwnStg
->
GetError
();
BaseStorageStream
*
p
=
m_pOwnStg
->
OpenStream
(
rEleName
,
nMode
,
(
nStorageMode
&
STORAGE_TRANSACTED
)
==
0
);
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
pStm
=
new
SotStorageStream
(
p
);
if
(
!
nE
)
...
...
sw/source/filter/ww8/ww8par.cxx
Dosyayı görüntüle @
cd5e167b
...
...
@@ -4842,7 +4842,7 @@ bool SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom,
if
(
!
aURL
.
endsWithIgnoreAsciiCase
(
".dot"
)
||
(
!
sCreatedFrom
.
isEmpty
()
&&
sCreatedFrom
.
equals
(
aURL
)
)
)
continue
;
// don't try and read the same document as ourselves
SotStorageRef
rRoot
=
new
SotStorage
(
aURL
,
STREAM_STD_READWRITE
,
S
TORAGE_TRANSACTED
);
SotStorageRef
rRoot
=
new
SotStorage
(
aURL
,
STREAM_STD_READWRITE
,
S
torageMode
::
Transacted
);
BasicProjImportHelper
aBasicImporter
(
*
m_pDocShell
);
// Import vba via oox filter
...
...
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