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
78a4b424
Kaydet (Commit)
78a4b424
authored
Mar 15, 2014
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SwapIn/SwapOut can return bool + sal_Bool to bool
Change-Id: Ia5477d6bb83af38435b9ac44359fe2f46b00807c
üst
cb375b90
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
51 deletions
+57
-51
grfmgr.hxx
include/svtools/grfmgr.hxx
+3
-3
grfmgr.cxx
svtools/source/graphic/grfmgr.cxx
+8
-8
ndgrf.hxx
sw/inc/ndgrf.hxx
+2
-2
swbaslnk.hxx
sw/inc/swbaslnk.hxx
+4
-4
notxtfrm.cxx
sw/source/core/doc/notxtfrm.cxx
+1
-1
swbaslnk.cxx
sw/source/core/docnode/swbaslnk.cxx
+14
-11
ndgrf.cxx
sw/source/core/graphic/ndgrf.cxx
+25
-22
No files found.
include/svtools/grfmgr.hxx
Dosyayı görüntüle @
78a4b424
...
...
@@ -403,9 +403,9 @@ public:
Link
GetAnimationNotifyHdl
()
const
{
return
maGraphic
.
GetAnimationNotifyHdl
();
}
sal_Bool
SwapOut
();
sal_Bool
SwapOut
(
SvStream
*
pOStm
);
sal_Bool
SwapIn
();
bool
SwapOut
();
bool
SwapOut
(
SvStream
*
pOStm
);
bool
SwapIn
();
sal_Bool
IsInSwapIn
()
const
{
return
mbIsInSwapIn
;
}
sal_Bool
IsInSwapOut
()
const
{
return
mbIsInSwapOut
;
}
...
...
svtools/source/graphic/grfmgr.cxx
Dosyayı görüntüle @
78a4b424
...
...
@@ -1055,9 +1055,9 @@ Graphic GraphicObject::GetTransformedGraphic( const GraphicAttr* pAttr ) const /
return
aGraphic
;
}
sal_B
ool
GraphicObject
::
SwapOut
()
b
ool
GraphicObject
::
SwapOut
()
{
sal_Bool
bRet
=
(
!
mbAutoSwapped
?
maGraphic
.
SwapOut
()
:
sal_False
);
const
bool
bRet
=
!
mbAutoSwapped
&&
maGraphic
.
SwapOut
(
);
if
(
bRet
&&
mpMgr
)
mpMgr
->
ImplGraphicObjectWasSwappedOut
(
*
this
);
...
...
@@ -1065,9 +1065,9 @@ sal_Bool GraphicObject::SwapOut()
return
bRet
;
}
sal_B
ool
GraphicObject
::
SwapOut
(
SvStream
*
pOStm
)
b
ool
GraphicObject
::
SwapOut
(
SvStream
*
pOStm
)
{
sal_Bool
bRet
=
(
!
mbAutoSwapped
?
maGraphic
.
SwapOut
(
pOStm
)
:
sal_False
);
const
bool
bRet
=
!
mbAutoSwapped
&&
maGraphic
.
SwapOut
(
pOStm
);
if
(
bRet
&&
mpMgr
)
mpMgr
->
ImplGraphicObjectWasSwappedOut
(
*
this
);
...
...
@@ -1075,17 +1075,17 @@ sal_Bool GraphicObject::SwapOut( SvStream* pOStm )
return
bRet
;
}
sal_B
ool
GraphicObject
::
SwapIn
()
b
ool
GraphicObject
::
SwapIn
()
{
sal_Bool
bRet
;
bool
bRet
=
false
;
if
(
mbAutoSwapped
)
{
ImplAutoSwapIn
();
bRet
=
sal_T
rue
;
bRet
=
t
rue
;
}
else
if
(
mpMgr
&&
mpMgr
->
ImplFillSwappedGraphicObject
(
*
this
,
maGraphic
)
)
bRet
=
sal_T
rue
;
bRet
=
t
rue
;
else
{
bRet
=
maGraphic
.
SwapIn
();
...
...
sw/inc/ndgrf.hxx
Dosyayı görüntüle @
78a4b424
...
...
@@ -171,9 +171,9 @@ public:
const
GraphicObject
*
pGrfObj
=
0
,
bool
bModify
=
true
);
/// Loading of graphic immediately before displaying.
short
SwapIn
(
bool
bWaitForData
=
false
);
bool
SwapIn
(
bool
bWaitForData
=
false
);
/// Remove graphic in order to free memory.
short
SwapOut
();
bool
SwapOut
();
/// Access to storage stream-name.
void
SetStreamName
(
const
OUString
&
r
)
{
maGrfObj
.
SetUserData
(
r
);
}
/// Is this node selected by any shell?
...
...
sw/inc/swbaslnk.hxx
Dosyayı görüntüle @
78a4b424
...
...
@@ -31,7 +31,7 @@ class SwBaseLink : public ::sfx2::SvBaseLink
friend
long
GrfNodeChanged
(
void
*
pLink
,
void
*
pCaller
);
SwCntntNode
*
pCntntNode
;
sal_B
ool
bSwapIn
:
1
;
b
ool
bSwapIn
:
1
;
sal_Bool
bNoDataFlag
:
1
;
sal_Bool
bIgnoreDataChanged
:
1
;
ReReadThread
*
m_pReReadThread
;
...
...
@@ -42,7 +42,7 @@ protected:
SwBaseLink
(
const
OUString
&
rNm
,
sal_uInt16
nObjectType
,
::
sfx2
::
SvLinkSource
*
pObj
,
SwCntntNode
*
pNode
=
0
)
:
::
sfx2
::
SvBaseLink
(
rNm
,
nObjectType
,
pObj
),
pCntntNode
(
pNode
),
bSwapIn
(
sal_F
alse
),
bNoDataFlag
(
sal_False
),
bIgnoreDataChanged
(
sal_False
),
bSwapIn
(
f
alse
),
bNoDataFlag
(
sal_False
),
bIgnoreDataChanged
(
sal_False
),
m_pReReadThread
(
0
)
{}
...
...
@@ -51,7 +51,7 @@ public:
SwBaseLink
(
sal_uInt16
nMode
,
sal_uInt16
nFormat
,
SwCntntNode
*
pNode
=
0
)
:
::
sfx2
::
SvBaseLink
(
nMode
,
nFormat
),
pCntntNode
(
pNode
),
bSwapIn
(
sal_F
alse
),
bNoDataFlag
(
sal_False
),
bIgnoreDataChanged
(
sal_False
),
bSwapIn
(
f
alse
),
bNoDataFlag
(
sal_False
),
bIgnoreDataChanged
(
sal_False
),
m_pReReadThread
(
0
)
{}
virtual
~
SwBaseLink
();
...
...
@@ -66,7 +66,7 @@ public:
SwCntntNode
*
GetCntntNode
()
{
return
pCntntNode
;
}
// For graphics only.
sal_Bool
SwapIn
(
sal_Bool
bWaitForData
=
sal_False
,
sal_Bool
bNativFormat
=
sal_F
alse
);
bool
SwapIn
(
bool
bWaitForData
=
false
,
bool
bNativFormat
=
f
alse
);
sal_Bool
Connect
()
{
return
0
!=
SvBaseLink
::
GetRealObject
();
}
...
...
sw/source/core/doc/notxtfrm.cxx
Dosyayı görüntüle @
78a4b424
...
...
@@ -855,7 +855,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
if
(
bContinue
)
{
const
sal_Bool
bSwapped
=
rGrfObj
.
IsSwappedOut
();
const
bool
bSwappedIn
=
0
!=
pGrfNd
->
SwapIn
(
bPrn
);
const
bool
bSwappedIn
=
pGrfNd
->
SwapIn
(
bPrn
);
if
(
bSwappedIn
&&
rGrfObj
.
GetGraphic
().
IsSupportedGraphic
())
{
const
bool
bAnimate
=
rGrfObj
.
IsAnimated
()
&&
...
...
sw/source/core/docnode/swbaslnk.cxx
Dosyayı görüntüle @
78a4b424
...
...
@@ -369,11 +369,9 @@ sal_Bool SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfN
return
bRet
;
}
sal_Bool
SwBaseLink
::
SwapIn
(
sal_Bool
bWaitForData
,
sal_B
ool
bNativFormat
)
bool
SwBaseLink
::
SwapIn
(
bool
bWaitForData
,
b
ool
bNativFormat
)
{
bSwapIn
=
sal_True
;
sal_Bool
bRes
;
bSwapIn
=
true
;
if
(
!
GetObj
()
&&
(
bNativFormat
||
(
!
IsSynchron
()
&&
bWaitForData
)
))
{
...
...
@@ -392,6 +390,8 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat )
}
#endif
bool
bRes
=
false
;
if
(
GetObj
()
)
{
OUString
aMimeType
(
SotExchange
::
GetFormatMimeType
(
GetContentType
()
));
...
...
@@ -401,14 +401,17 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat )
if
(
bWaitForData
&&
!
GetObj
()
)
{
OSL_ENSURE
(
!
this
,
"The SvxFileObject was deleted in a GetData!"
);
bRes
=
sal_False
;
}
else
if
(
0
!=
(
bRes
=
aValue
.
hasValue
()
)
)
else
{
// The Flag needs to be reset on a SwapIn, because
// we want to reapply the data.
bIgnoreDataChanged
=
sal_False
;
DataChanged
(
aMimeType
,
aValue
);
bRes
=
aValue
.
hasValue
();
if
(
bRes
)
{
// The Flag needs to be reset on a SwapIn, because
// we want to reapply the data.
bIgnoreDataChanged
=
sal_False
;
DataChanged
(
aMimeType
,
aValue
);
}
}
}
else
if
(
!
IsSynchron
()
&&
bWaitForData
)
...
...
@@ -420,7 +423,7 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat )
else
bRes
=
Update
();
bSwapIn
=
sal_F
alse
;
bSwapIn
=
f
alse
;
return
bRes
;
}
...
...
sw/source/core/graphic/ndgrf.cxx
Dosyayı görüntüle @
78a4b424
...
...
@@ -517,16 +517,15 @@ StreamAndStorageNames lcl_GetStreamStorageNames( const OUString sUserData )
}
/**
* @return -1 if ReRead successful,
* 1 if reading successful,
* 0 if not loaded
* @return true if ReRead or reading successful,
* false if not loaded
*/
short
SwGrfNode
::
SwapIn
(
bool
bWaitForData
)
bool
SwGrfNode
::
SwapIn
(
bool
bWaitForData
)
{
if
(
bInSwapIn
)
// not recursively!
return
short
(
!
maGrfObj
.
IsSwappedOut
()
);
return
!
maGrfObj
.
IsSwappedOut
(
);
short
nRet
=
0
;
bool
bRet
=
false
;
bInSwapIn
=
true
;
SwBaseLink
*
pLink
=
(
SwBaseLink
*
)(
::
sfx2
::
SvBaseLink
*
)
refLink
;
...
...
@@ -537,7 +536,9 @@ short SwGrfNode::SwapIn( bool bWaitForData )
{
// link was not loaded yet
if
(
pLink
->
SwapIn
(
bWaitForData
)
)
nRet
=
-
1
;
{
bRet
=
true
;
}
else
if
(
GRAPHIC_DEFAULT
==
maGrfObj
.
GetType
()
)
{
// no default bitmap anymore, thus re-paint
...
...
@@ -550,18 +551,21 @@ short SwGrfNode::SwapIn( bool bWaitForData )
ModifyNotification
(
&
aMsgHint
,
&
aMsgHint
);
}
}
else
if
(
maGrfObj
.
IsSwappedOut
()
)
{
else
if
(
maGrfObj
.
IsSwappedOut
()
)
{
// link to download
nRet
=
pLink
->
SwapIn
(
bWaitForData
)
?
1
:
0
;
bRet
=
pLink
->
SwapIn
(
bWaitForData
)
;
}
else
nRet
=
1
;
bRet
=
true
;
}
else
if
(
maGrfObj
.
IsSwappedOut
()
)
{
// graphic is in storage or in a temp file
if
(
!
HasStreamName
()
)
nRet
=
(
short
)
maGrfObj
.
SwapIn
();
{
bRet
=
maGrfObj
.
SwapIn
();
}
else
{
try
...
...
@@ -571,8 +575,7 @@ short SwGrfNode::SwapIn( bool bWaitForData )
SvStream
*
pStrm
=
_GetStreamForEmbedGrf
(
refPics
,
aNames
.
sStream
);
if
(
pStrm
)
{
if
(
ImportGraphic
(
*
pStrm
)
)
nRet
=
1
;
bRet
=
ImportGraphic
(
*
pStrm
);
delete
pStrm
;
}
}
...
...
@@ -583,26 +586,26 @@ short SwGrfNode::SwapIn( bool bWaitForData )
}
}
if
(
1
==
n
Ret
)
if
(
b
Ret
)
{
SwMsgPoolItem
aMsg
(
RES_GRAPHIC_SWAPIN
);
ModifyNotification
(
&
aMsg
,
&
aMsg
);
}
}
else
nRet
=
1
;
OSL_ENSURE
(
n
Ret
,
"Cannot swap in graphic"
);
bRet
=
true
;
OSL_ENSURE
(
b
Ret
,
"Cannot swap in graphic"
);
if
(
n
Ret
)
if
(
b
Ret
)
{
if
(
!
nGrfSize
.
Width
()
&&
!
nGrfSize
.
Height
()
)
SetTwipSize
(
::
GetGraphicSizeTwip
(
maGrfObj
.
GetGraphic
(),
0
)
);
}
bInSwapIn
=
false
;
return
n
Ret
;
return
b
Ret
;
}
short
SwGrfNode
::
SwapOut
()
bool
SwGrfNode
::
SwapOut
()
{
if
(
maGrfObj
.
GetType
()
!=
GRAPHIC_DEFAULT
&&
maGrfObj
.
GetType
()
!=
GRAPHIC_NONE
&&
...
...
@@ -615,12 +618,12 @@ short SwGrfNode::SwapOut()
// if there is no stream name in the storage yet
if
(
!
HasStreamName
()
)
if
(
!
maGrfObj
.
SwapOut
()
)
return
0
;
return
false
;
}
// written graphics and links are removed here
return
(
short
)
maGrfObj
.
SwapOut
(
NULL
);
return
maGrfObj
.
SwapOut
(
NULL
);
}
return
1
;
return
true
;
}
bool
SwGrfNode
::
GetFileFilterNms
(
OUString
*
pFileNm
,
OUString
*
pFilterNm
)
const
...
...
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