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
9b1b3c9f
Kaydet (Commit)
9b1b3c9f
authored
May 07, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Reduce enum class StorageMode to bool transacted
Change-Id: I04e53d7de9f2f26e9338a82f7d5ae5dab1682712
üst
79d853e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
24 deletions
+11
-24
storage.hxx
include/sot/storage.hxx
+1
-14
storage.cxx
sot/source/sdstor/storage.cxx
+10
-10
No files found.
include/sot/storage.hxx
Dosyayı görüntüle @
9b1b3c9f
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <o3tl/typed_flags_set.hxx>
#include <sot/object.hxx>
#include <sot/object.hxx>
#include <sot/factory.hxx>
#include <sot/factory.hxx>
#include <tools/stream.hxx>
#include <tools/stream.hxx>
...
@@ -33,18 +32,6 @@
...
@@ -33,18 +32,6 @@
#include <sot/storinfo.hxx>
#include <sot/storinfo.hxx>
#include <sot/sotdllapi.h>
#include <sot/sotdllapi.h>
enum
class
StorageMode
{
Default
=
0
,
Transacted
=
0x04
};
namespace
o3tl
{
template
<>
struct
typed_flags
<
StorageMode
>:
is_typed_flags
<
StorageMode
,
0x04
>
{};
}
class
SotStorage
;
class
SotStorage
;
enum
class
SotClipboardFormatId
:
sal_uLong
;
enum
class
SotClipboardFormatId
:
sal_uLong
;
...
@@ -111,7 +98,7 @@ friend class SotStorage;
...
@@ -111,7 +98,7 @@ friend class SotStorage;
protected
:
protected
:
virtual
~
SotStorage
();
virtual
~
SotStorage
();
void
CreateStorage
(
bool
bUCBStorage
,
StreamMode
,
StorageMode
);
void
CreateStorage
(
bool
bUCBStorage
,
StreamMode
,
bool
transacted
);
public
:
public
:
SotStorage
(
const
OUString
&
,
SotStorage
(
const
OUString
&
,
StreamMode
=
STREAM_STD_READWRITE
,
StreamMode
=
STREAM_STD_READWRITE
,
...
...
sot/source/sdstor/storage.cxx
Dosyayı görüntüle @
9b1b3c9f
...
@@ -337,12 +337,12 @@ SotStorage::SotStorage( const OUString & rName, StreamMode nMode, bool transacte
...
@@ -337,12 +337,12 @@ SotStorage::SotStorage( const OUString & rName, StreamMode nMode, bool transacte
INIT_SotStorage
()
INIT_SotStorage
()
{
{
m_aName
=
rName
;
// Namen merken
m_aName
=
rName
;
// Namen merken
CreateStorage
(
true
,
nMode
,
transacted
?
StorageMode
::
Transacted
:
StorageMode
::
Default
);
CreateStorage
(
true
,
nMode
,
transacted
);
if
(
IsOLEStorage
()
)
if
(
IsOLEStorage
()
)
m_nVersion
=
SOFFICE_FILEFORMAT_50
;
m_nVersion
=
SOFFICE_FILEFORMAT_50
;
}
}
void
SotStorage
::
CreateStorage
(
bool
bForceUCBStorage
,
StreamMode
nMode
,
StorageMode
nStorageMode
)
void
SotStorage
::
CreateStorage
(
bool
bForceUCBStorage
,
StreamMode
nMode
,
bool
transacted
)
{
{
DBG_ASSERT
(
!
m_pStorStm
&&
!
m_pOwnStg
,
"Use only in ctor!"
);
DBG_ASSERT
(
!
m_pStorStm
&&
!
m_pOwnStg
,
"Use only in ctor!"
);
if
(
!
m_aName
.
isEmpty
()
)
if
(
!
m_aName
.
isEmpty
()
)
...
@@ -378,31 +378,31 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage
...
@@ -378,31 +378,31 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage
if
(
!
(
UCBStorage
::
GetLinkedFile
(
*
m_pStorStm
).
isEmpty
())
)
if
(
!
(
UCBStorage
::
GetLinkedFile
(
*
m_pStorStm
).
isEmpty
())
)
{
{
// detect special unpacked storages
// detect special unpacked storages
m_pOwnStg
=
new
UCBStorage
(
*
m_pStorStm
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
m_pOwnStg
=
new
UCBStorage
(
*
m_pStorStm
,
!
transacted
);
m_bDelStm
=
true
;
m_bDelStm
=
true
;
}
}
else
else
{
{
// UCBStorage always works directly on the UCB content, so discard the stream first
// UCBStorage always works directly on the UCB content, so discard the stream first
DELETEZ
(
m_pStorStm
);
DELETEZ
(
m_pStorStm
);
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
!
transacted
);
}
}
}
}
else
else
{
{
// OLEStorage can be opened with a stream
// OLEStorage can be opened with a stream
m_pOwnStg
=
new
Storage
(
*
m_pStorStm
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
m_pOwnStg
=
new
Storage
(
*
m_pStorStm
,
!
transacted
);
m_bDelStm
=
true
;
m_bDelStm
=
true
;
}
}
}
}
else
if
(
bForceUCBStorage
)
else
if
(
bForceUCBStorage
)
{
{
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
!
transacted
);
SetError
(
ERRCODE_IO_NOTSUPPORTED
);
SetError
(
ERRCODE_IO_NOTSUPPORTED
);
}
}
else
else
{
{
m_pOwnStg
=
new
Storage
(
m_aName
,
nMode
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
m_pOwnStg
=
new
Storage
(
m_aName
,
nMode
,
!
transacted
);
SetError
(
ERRCODE_IO_NOTSUPPORTED
);
SetError
(
ERRCODE_IO_NOTSUPPORTED
);
}
}
}
}
...
@@ -410,9 +410,9 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage
...
@@ -410,9 +410,9 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage
{
{
// temporary storage
// temporary storage
if
(
bForceUCBStorage
)
if
(
bForceUCBStorage
)
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
m_pOwnStg
=
new
UCBStorage
(
m_aName
,
nMode
,
!
transacted
);
else
else
m_pOwnStg
=
new
Storage
(
m_aName
,
nMode
,
!
(
nStorageMode
&
StorageMode
::
Transacted
)
);
m_pOwnStg
=
new
Storage
(
m_aName
,
nMode
,
!
transacted
);
m_aName
=
m_pOwnStg
->
GetName
();
m_aName
=
m_pOwnStg
->
GetName
();
}
}
...
@@ -425,7 +425,7 @@ SotStorage::SotStorage( bool bUCBStorage, const OUString & rName, StreamMode nMo
...
@@ -425,7 +425,7 @@ SotStorage::SotStorage( bool bUCBStorage, const OUString & rName, StreamMode nMo
INIT_SotStorage
()
INIT_SotStorage
()
{
{
m_aName
=
rName
;
m_aName
=
rName
;
CreateStorage
(
bUCBStorage
,
nMode
,
StorageMode
::
Default
);
CreateStorage
(
bUCBStorage
,
nMode
,
false
);
if
(
IsOLEStorage
()
)
if
(
IsOLEStorage
()
)
m_nVersion
=
SOFFICE_FILEFORMAT_50
;
m_nVersion
=
SOFFICE_FILEFORMAT_50
;
}
}
...
...
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