[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - filter/source oox/source svtools/source svx/source sw/source vcl/inc vcl/source
Oliver-Rainer Wittmann
orw at apache.org
Thu Feb 27 06:08:35 PST 2014
filter/source/msfilter/escherex.cxx | 32 ++++++++-
oox/source/export/drawingml.cxx | 8 ++
svtools/source/filter/filter.cxx | 8 ++
svtools/source/graphic/descriptor.cxx | 4 +
svx/source/gallery2/galtheme.cxx | 5 +
svx/source/xml/xmlgrhlp.cxx | 4 +
svx/source/xoutdev/_xoutbmp.cxx | 4 +
sw/source/core/doc/docedt.cxx | 48 ++++++-------
sw/source/core/doc/docredln.cxx | 16 ++--
sw/source/core/edit/edundo.cxx | 2
sw/source/core/inc/UndoRedline.hxx | 10 +-
sw/source/core/undo/undobj.cxx | 97 +++++++++++++++-------------
sw/source/core/undo/unredln.cxx | 54 +++++++--------
sw/source/filter/ww8/rtfattributeoutput.cxx | 13 +++
sw/source/ui/docvw/romenu.cxx | 4 +
vcl/inc/vcl/gfxlink.hxx | 6 +
vcl/source/gdi/gfxlink.cxx | 4 +
17 files changed, 209 insertions(+), 110 deletions(-)
New commits:
commit e8613c7e3b76a83d804d28199fdeacc6369569c6
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Thu Feb 27 14:00:06 2014 +0000
123480: assure correct Undo/Redo with not shown tracked changes
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index fa42f2d..d8f1008 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -1561,50 +1561,48 @@ bool SwDoc::DeleteAndJoinWithRedlineImpl( SwPaM & rPam, const bool )
{
SwUndoRedlineDelete* pUndo = 0;
RedlineMode_t eOld = GetRedlineMode();
- checkRedlining(eOld);
+ checkRedlining( eOld );
if (GetIDocumentUndoRedo().DoesUndo())
{
- //JP 06.01.98: MUSS noch optimiert werden!!!
- SetRedlineMode(
- (RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE ));
+ //JP 06.01.98: MUSS noch optimiert werden!!!
+ SetRedlineMode(
+ (RedlineMode_t) ( nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE ) );
- GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().StartUndo( UNDO_DELETE, NULL );
pUndo = new SwUndoRedlineDelete( rPam, UNDO_DELETE );
- GetIDocumentUndoRedo().AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
- if( *rPam.GetPoint() != *rPam.GetMark() )
- AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_DELETE, rPam ), true);
+
+ if ( *rPam.GetPoint() != *rPam.GetMark() )
+ AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_DELETE, rPam ), true );
SetModified();
- if( pUndo )
+ if ( pUndo )
{
- GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo( UNDO_EMPTY, NULL );
// ??? why the hell is the AppendUndo not below the
// CanGrouping, so this hideous cleanup wouldn't be necessary?
// bah, this is redlining, probably changing this would break it...
- if (GetIDocumentUndoRedo().DoesGroupUndo())
+ if ( GetIDocumentUndoRedo().DoesGroupUndo() )
{
- SwUndo *const pLastUndo( GetUndoManager().GetLastUndo() );
- SwUndoRedlineDelete *const pUndoRedlineDel(
- dynamic_cast<SwUndoRedlineDelete*>(pLastUndo) );
- if (pUndoRedlineDel)
+ SwUndo * const pLastUndo( GetUndoManager().GetLastUndo() );
+ SwUndoRedlineDelete * const pUndoRedlineDel( dynamic_cast< SwUndoRedlineDelete* >( pLastUndo ) );
+ if ( pUndoRedlineDel )
{
- bool const bMerged = pUndoRedlineDel->CanGrouping(*pUndo);
- if (bMerged)
+ bool const bMerged = pUndoRedlineDel->CanGrouping( *pUndo );
+ if ( bMerged )
{
- ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
- SwUndo const*const pDeleted =
- GetUndoManager().RemoveLastUndo();
- OSL_ENSURE(pDeleted == pUndo,
- "DeleteAndJoinWithRedlineImpl: "
- "undo removed is not undo inserted?");
+ ::sw::UndoGuard const undoGuard( GetIDocumentUndoRedo() );
+ SwUndo const* const pDeleted = GetUndoManager().RemoveLastUndo();
+ OSL_ENSURE( pDeleted == pUndo, "DeleteAndJoinWithRedlineImpl: "
+ "undo removed is not undo inserted?" );
delete pDeleted;
}
}
}
-//JP 06.01.98: MUSS noch optimiert werden!!!
-SetRedlineMode( eOld );
+ //JP 06.01.98: MUSS noch optimiert werden!!!
+ SetRedlineMode( eOld );
}
return true;
}
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index cffb44f..29861ad 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -3013,12 +3013,16 @@ SwRedlineData::SwRedlineData( RedlineType_t eT, sal_uInt16 nAut )
aStamp.Set100Sec( 0 );
}
-SwRedlineData::SwRedlineData( const SwRedlineData& rCpy, sal_Bool bCpyNext )
- :
- pNext( (bCpyNext && rCpy.pNext) ? new SwRedlineData( *rCpy.pNext ) : 0 ),
- pExtraData( rCpy.pExtraData ? rCpy.pExtraData->CreateNew() : 0 ),
- sComment( rCpy.sComment ), aStamp( rCpy.aStamp ), eType( rCpy.eType ),
- nAuthor( rCpy.nAuthor ), nSeqNo( rCpy.nSeqNo )
+SwRedlineData::SwRedlineData(
+ const SwRedlineData& rCpy,
+ sal_Bool bCpyNext )
+ : pNext( ( bCpyNext && rCpy.pNext ) ? new SwRedlineData( *rCpy.pNext ) : 0 )
+ , pExtraData( rCpy.pExtraData ? rCpy.pExtraData->CreateNew() : 0 )
+ , sComment( rCpy.sComment )
+ , aStamp( rCpy.aStamp )
+ , eType( rCpy.eType )
+ , nAuthor( rCpy.nAuthor )
+ , nSeqNo( rCpy.nSeqNo )
{
}
diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index db8f9d3..045c698 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -125,7 +125,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount)
// Erkennung darf nur noch fuer die neue "Box" erfolgen!
ClearTblBoxCntnt();
- RedlineMode_t eOld = GetDoc()->GetRedlineMode();
+ const RedlineMode_t eOld = GetDoc()->GetRedlineMode();
try {
for (sal_uInt16 i = 0; i < nCount; ++i)
diff --git a/sw/source/core/inc/UndoRedline.hxx b/sw/source/core/inc/UndoRedline.hxx
index 95c07f4..a531dc6 100644
--- a/sw/source/core/inc/UndoRedline.hxx
+++ b/sw/source/core/inc/UndoRedline.hxx
@@ -38,10 +38,10 @@ class SwUndoDelete;
class SwUndoRedline : public SwUndo, public SwUndRng
{
protected:
- SwRedlineData* pRedlData;
- SwRedlineSaveDatas* pRedlSaveData;
- SwUndoId nUserId;
- sal_Bool bHiddenRedlines;
+ SwRedlineData* mpRedlData;
+ SwRedlineSaveDatas* mpRedlSaveData;
+ SwUndoId mnUserId;
+ sal_Bool mbHiddenRedlines;
virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
@@ -54,7 +54,7 @@ public:
virtual void UndoImpl( ::sw::UndoRedoContext & );
virtual void RedoImpl( ::sw::UndoRedoContext & );
- SwUndoId GetUserId() const { return nUserId; }
+ SwUndoId GetUserId() const { return mnUserId; }
sal_uInt16 GetRedlSaveCount() const;
};
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index b6b4075..fd6e376 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -47,17 +47,23 @@
#include <comcore.hrc>
#include <docsh.hxx>
-class SwRedlineSaveData : public SwUndRng, public SwRedlineData,
- private SwUndoSaveSection
+class SwRedlineSaveData: public SwUndRng, public SwRedlineData, private SwUndoSaveSection
{
public:
- SwRedlineSaveData( SwComparePosition eCmpPos,
- const SwPosition& rSttPos, const SwPosition& rEndPos,
- SwRedline& rRedl, sal_Bool bCopyNext );
+ SwRedlineSaveData(
+ SwComparePosition eCmpPos,
+ const SwPosition& rSttPos,
+ const SwPosition& rEndPos,
+ SwRedline& rRedl );
+
~SwRedlineSaveData();
+
void RedlineToDoc( SwPaM& rPam );
+
SwNodeIndex* GetMvSttIdx() const
- { return SwUndoSaveSection::GetMvSttIdx(); }
+ {
+ return SwUndoSaveSection::GetMvSttIdx();
+ }
#ifdef DBG_UTIL
sal_uInt16 nRedlineCount;
@@ -246,7 +252,7 @@ void SwUndo::UndoWithContext(SfxUndoContext & rContext)
dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
OSL_ASSERT(pContext);
if (!pContext) { return; }
- UndoRedoRedlineGuard(*pContext, *this);
+ const UndoRedoRedlineGuard aUndoRedoRedlineGuard(*pContext, *this);
UndoImpl(*pContext);
}
@@ -256,7 +262,7 @@ void SwUndo::RedoWithContext(SfxUndoContext & rContext)
dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
OSL_ASSERT(pContext);
if (!pContext) { return; }
- UndoRedoRedlineGuard(*pContext, *this);
+ const UndoRedoRedlineGuard aUndoRedoRedlineGuard(*pContext, *this);
RedoImpl(*pContext);
}
@@ -990,18 +996,17 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, const SwNodeIndex& rInsPos
// sicher und setze die RedlineDaten
-SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
- const SwPosition& rSttPos,
- const SwPosition& rEndPos,
- SwRedline& rRedl,
- sal_Bool bCopyNext )
- : SwUndRng( rRedl ),
- SwRedlineData( rRedl.GetRedlineData(), bCopyNext )
+SwRedlineSaveData::SwRedlineSaveData(
+ SwComparePosition eCmpPos,
+ const SwPosition& rSttPos,
+ const SwPosition& rEndPos,
+ SwRedline& rRedl )
+ : SwUndRng( rRedl )
+ , SwRedlineData( rRedl.GetRedlineData(), sal_True )
{
- ASSERT( POS_OUTSIDE == eCmpPos ||
- !rRedl.GetContentIdx(), "Redline mit Content" );
+ ASSERT( POS_OUTSIDE == eCmpPos || !rRedl.GetContentIdx(), "Redline mit Content" );
- switch( eCmpPos )
+ switch (eCmpPos)
{
case POS_OVERLAP_BEFORE: // Pos1 ueberlappt Pos2 am Anfang
nEndNode = rEndPos.nNode.GetIndex();
@@ -1020,7 +1025,7 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
break;
case POS_OUTSIDE: // Pos2 liegt vollstaendig in Pos1
- if( rRedl.GetContentIdx() )
+ if ( rRedl.GetContentIdx() )
{
// dann den Bereich ins UndoArray verschieben und merken
SaveSection( rRedl.GetDoc(), *rRedl.GetContentIdx() );
@@ -1078,39 +1083,48 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
rDoc.SetRedlineMode_intern( eOld );
}
-sal_Bool SwUndo::FillSaveData( const SwPaM& rRange, SwRedlineSaveDatas& rSData,
- sal_Bool bDelRange, sal_Bool bCopyNext )
+sal_Bool SwUndo::FillSaveData(
+ const SwPaM& rRange,
+ SwRedlineSaveDatas& rSData,
+ sal_Bool bDelRange,
+ sal_Bool bCopyNext )
{
- if( rSData.Count() )
+ if ( rSData.Count() )
+ {
rSData.DeleteAndDestroy( 0, rSData.Count() );
+ }
SwRedlineSaveData* pNewData;
- const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End();
+ const SwPosition* pStt = rRange.Start();
+ const SwPosition* pEnd = rRange.End();
const SwRedlineTbl& rTbl = rRange.GetDoc()->GetRedlineTbl();
sal_uInt16 n = 0;
rRange.GetDoc()->GetRedline( *pStt, &n );
- for( ; n < rTbl.Count(); ++n )
+ for ( ; n < rTbl.Count(); ++n )
{
- SwRedline* pRedl = rTbl[ n ];
- const SwPosition *pRStt = pRedl->Start(), *pREnd = pRedl->End();
-
- SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRStt, *pREnd );
- if( POS_BEFORE != eCmpPos && POS_BEHIND != eCmpPos &&
- POS_COLLIDE_END != eCmpPos && POS_COLLIDE_START != eCmpPos )
+ SwRedline* pRedl = rTbl[n];
+ const SwComparePosition eCmpPos =
+ ComparePosition( *pStt, *pEnd, *pRedl->Start(), *pRedl->End() );
+ if ( eCmpPos != POS_BEFORE
+ && eCmpPos != POS_BEHIND
+ && eCmpPos != POS_COLLIDE_END
+ && eCmpPos != POS_COLLIDE_START )
{
- pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd,
- *pRedl, bCopyNext );
+ pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl );
rSData.Insert( pNewData, rSData.Count() );
}
}
- if( rSData.Count() && bDelRange )
+
+ if ( rSData.Count() && bDelRange )
rRange.GetDoc()->DeleteRedline( rRange, false, USHRT_MAX );
return 0 != rSData.Count();
}
-sal_Bool SwUndo::FillSaveDataForFmt( const SwPaM& rRange, SwRedlineSaveDatas& rSData )
+sal_Bool SwUndo::FillSaveDataForFmt(
+ const SwPaM& rRange,
+ SwRedlineSaveDatas& rSData )
{
- if( rSData.Count() )
+ if ( rSData.Count() )
rSData.DeleteAndDestroy( 0, rSData.Count() );
SwRedlineSaveData* pNewData;
@@ -1118,23 +1132,20 @@ sal_Bool SwUndo::FillSaveDataForFmt( const SwPaM& rRange, SwRedlineSaveDatas& rS
const SwRedlineTbl& rTbl = rRange.GetDoc()->GetRedlineTbl();
sal_uInt16 n = 0;
rRange.GetDoc()->GetRedline( *pStt, &n );
- for( ; n < rTbl.Count(); ++n )
+ for ( ; n < rTbl.Count(); ++n )
{
- SwRedline* pRedl = rTbl[ n ];
- if( nsRedlineType_t::REDLINE_FORMAT == pRedl->GetType() )
+ SwRedline* pRedl = rTbl[n];
+ if ( nsRedlineType_t::REDLINE_FORMAT == pRedl->GetType() )
{
const SwPosition *pRStt = pRedl->Start(), *pREnd = pRedl->End();
SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRStt, *pREnd );
- if( POS_BEFORE != eCmpPos && POS_BEHIND != eCmpPos &&
- POS_COLLIDE_END != eCmpPos && POS_COLLIDE_START != eCmpPos )
+ if ( POS_BEFORE != eCmpPos && POS_BEHIND != eCmpPos && POS_COLLIDE_END != eCmpPos && POS_COLLIDE_START != eCmpPos )
{
- pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd,
- *pRedl, sal_True );
+ pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl );
rSData.Insert( pNewData, rSData.Count() );
}
-
}
}
return 0 != rSData.Count();
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 779cd2c..1b00bb2 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -46,18 +46,18 @@ extern void lcl_GetJoinFlags( SwPaM& rPam, sal_Bool& rJoinTxt, sal_Bool& rJoinPr
SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
: SwUndo( UNDO_REDLINE ), SwUndRng( rRange ),
- pRedlData( 0 ), pRedlSaveData( 0 ), nUserId( nUsrId ),
- bHiddenRedlines( sal_False )
+ mpRedlData( 0 ), mpRedlSaveData( 0 ), mnUserId( nUsrId ),
+ mbHiddenRedlines( sal_False )
{
// Redline beachten
SwDoc& rDoc = *rRange.GetDoc();
if( rDoc.IsRedlineOn() )
{
- switch( nUserId )
+ switch( mnUserId )
{
case UNDO_DELETE:
case UNDO_REPLACE:
- pRedlData = new SwRedlineData( nsRedlineType_t::REDLINE_DELETE, rDoc.GetRedlineAuthor() );
+ mpRedlData = new SwRedlineData( nsRedlineType_t::REDLINE_DELETE, rDoc.GetRedlineAuthor() );
break;
default:
;
@@ -67,14 +67,14 @@ SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
- pRedlSaveData = new SwRedlineSaveDatas;
- if( !FillSaveData( rRange, *pRedlSaveData, sal_False,
- UNDO_REJECT_REDLINE != nUserId ))
- delete pRedlSaveData, pRedlSaveData = 0;
+ mpRedlSaveData = new SwRedlineSaveDatas;
+ if( !FillSaveData( rRange, *mpRedlSaveData, sal_False,
+ UNDO_REJECT_REDLINE != mnUserId ))
+ delete mpRedlSaveData, mpRedlSaveData = 0;
else
{
- bHiddenRedlines = HasHiddenRedlines( *pRedlSaveData );
- if( bHiddenRedlines ) // dann muessen die NodeIndizies
+ mbHiddenRedlines = HasHiddenRedlines( *mpRedlSaveData );
+ if( mbHiddenRedlines ) // dann muessen die NodeIndizies
{ // vom SwUndRng korrigiert werden
nEndExtra -= rDoc.GetNodes().GetEndOfExtras().GetIndex();
nSttNode -= nEndExtra;
@@ -85,13 +85,13 @@ SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
SwUndoRedline::~SwUndoRedline()
{
- delete pRedlData;
- delete pRedlSaveData;
+ delete mpRedlData;
+ delete mpRedlSaveData;
}
sal_uInt16 SwUndoRedline::GetRedlSaveCount() const
{
- return pRedlSaveData ? pRedlSaveData->Count() : 0;
+ return mpRedlSaveData ? mpRedlSaveData->Count() : 0;
}
@@ -102,13 +102,13 @@ void SwUndoRedline::UndoImpl(::sw::UndoRedoContext & rContext)
UndoRedlineImpl(*pDoc, rPam);
- if( pRedlSaveData )
+ if( mpRedlSaveData )
{
sal_uLong nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
- SetSaveData( *pDoc, *pRedlSaveData );
- if( bHiddenRedlines )
+ SetSaveData( *pDoc, *mpRedlSaveData );
+ if( mbHiddenRedlines )
{
- pRedlSaveData->DeleteAndDestroy( 0, pRedlSaveData->Count() );
+ mpRedlSaveData->DeleteAndDestroy( 0, mpRedlSaveData->Count() );
nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex() - nEndExtra;
nSttNode += nEndExtra;
@@ -126,11 +126,11 @@ void SwUndoRedline::RedoImpl(::sw::UndoRedoContext & rContext)
pDoc->SetRedlineMode_intern((RedlineMode_t)(( eOld & ~nsRedlineMode_t::REDLINE_IGNORE) | nsRedlineMode_t::REDLINE_ON ));
SwPaM & rPam( AddUndoRedoPaM(rContext) );
- if( pRedlSaveData && bHiddenRedlines )
+ if( mpRedlSaveData && mbHiddenRedlines )
{
sal_uLong nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
- FillSaveData(rPam, *pRedlSaveData, sal_False,
- UNDO_REJECT_REDLINE != nUserId );
+ FillSaveData(rPam, *mpRedlSaveData, sal_False,
+ UNDO_REJECT_REDLINE != mnUserId );
nEndExtra -= pDoc->GetNodes().GetEndOfExtras().GetIndex();
nSttNode -= nEndExtra;
@@ -161,7 +161,7 @@ SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId )
bCanGroup( sal_False ), bIsDelim( sal_False ), bIsBackspace( sal_False )
{
const SwTxtNode* pTNd;
- if( UNDO_DELETE == nUserId &&
+ if( UNDO_DELETE == mnUserId &&
nSttNode == nEndNode && nSttCntnt + 1 == nEndCntnt &&
0 != (pTNd = rRange.GetNode()->GetTxtNode()) )
{
@@ -187,14 +187,14 @@ void SwUndoRedlineDelete::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
if (rPam.GetPoint() != rPam.GetMark())
{
- rDoc.AppendRedline( new SwRedline(*pRedlData, rPam), sal_False );
+ rDoc.AppendRedline( new SwRedline(*mpRedlData, rPam), sal_False );
}
}
sal_Bool SwUndoRedlineDelete::CanGrouping( const SwUndoRedlineDelete& rNext )
{
sal_Bool bRet = sal_False;
- if( UNDO_DELETE == nUserId && nUserId == rNext.nUserId &&
+ if( UNDO_DELETE == mnUserId && mnUserId == rNext.mnUserId &&
bCanGroup == rNext.bCanGroup &&
bIsDelim == rNext.bIsDelim &&
bIsBackspace == rNext.bIsBackspace &&
@@ -209,10 +209,10 @@ sal_Bool SwUndoRedlineDelete::CanGrouping( const SwUndoRedlineDelete& rNext )
bIsEnd = -1;
if( bIsEnd &&
- (( !pRedlSaveData && !rNext.pRedlSaveData ) ||
- ( pRedlSaveData && rNext.pRedlSaveData &&
- SwUndo::CanRedlineGroup( *pRedlSaveData,
- *rNext.pRedlSaveData, 1 != bIsEnd )
+ (( !mpRedlSaveData && !rNext.mpRedlSaveData ) ||
+ ( mpRedlSaveData && rNext.mpRedlSaveData &&
+ SwUndo::CanRedlineGroup( *mpRedlSaveData,
+ *rNext.mpRedlSaveData, 1 != bIsEnd )
)))
{
if( 1 == bIsEnd )
commit 9956ed1303545cd61901e33b110698c4e5e224c4
Author: Armin Le Grand <alg at apache.org>
Date: Thu Feb 27 13:46:24 2014 +0000
i15508 Added support for BMP file type
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index ad10d28..28932a0 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -4373,6 +4373,15 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteSt
{
case GFX_LINK_TYPE_NATIVE_JPG : p_EscherBlibEntry->meBlibType = PEG; break;
case GFX_LINK_TYPE_NATIVE_PNG : p_EscherBlibEntry->meBlibType = PNG; break;
+
+ // #15508# added BMP type for better exports; need to check this
+ // checked - does not work that way, so keep out for now. It may
+ // work somehow with direct DIB data, but that would need to be checked
+ // carefully
+ // for more comments please check RtfAttributeOutput::FlyFrameGraphic
+ //
+ // case GFX_LINK_TYPE_NATIVE_BMP : p_EscherBlibEntry->meBlibType = DIB; break;
+
case GFX_LINK_TYPE_NATIVE_WMF :
{
if ( pGraphicAry && ( p_EscherBlibEntry->mnSize > 0x2c ) )
@@ -4472,11 +4481,30 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteSt
else if ( eBlibType == PEG )
rPicOutStrm << (sal_uInt16)0x0505;
}
- if ( ( eBlibType == PEG ) || ( eBlibType == PNG ) )
+ if ( ( eBlibType == PEG ) || ( eBlibType == PNG ) ) // || ( eBlibType == DIB )) // #15508#
{
nExtra = 17;
p_EscherBlibEntry->mnSizeExtra = nExtra + 8;
- nInstance = ( eBlibType == PNG ) ? 0xf01e6e00 : 0xf01d46a0;
+
+ // #15508# type see SvxMSDffManager::GetBLIPDirect (checked, does not work this way)
+ // see RtfAttributeOutput::FlyFrameGraphic for more comments
+ // maybe it would work with direct DIB data, but that would need thorough testing
+ if( eBlibType == PNG )
+ {
+ nInstance = 0xf01e6e00;
+ }
+ else // if( eBlibType == PEG )
+ {
+ nInstance = 0xf01d46a0;
+ }
+ //else // eBlibType == DIB
+ //{
+ // nInstance = 0xf01d7A80;
+ //}
+
+ // #15508#
+ //nInstance = ( eBlibType == PNG ) ? 0xf01e6e00 : 0xf01d46a0;
+
rPicOutStrm << nInstance << (sal_uInt32)( p_EscherBlibEntry->mnSize + nExtra );
rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 );
rPicOutStrm << (sal_uInt8)0xff;
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 18395f8..7b58de0 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -426,6 +426,14 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
sMediaType = US( "image/gif" );
sExtension = ".gif";
break;
+
+ // #15508# added BMP type for better exports
+ // export not yet active, so adding for reference (not checked)
+ case GFX_LINK_TYPE_NATIVE_BMP:
+ sMediaType = US( "image/bmp" );
+ sExtension = ".bmp";
+ break;
+
case GFX_LINK_TYPE_NATIVE_JPG:
sMediaType = US( "image/jpeg" );
sExtension = ".jpeg";
diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index 9733bae..7b47488 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -1635,8 +1635,16 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath,
{
// SV interne Importfilter fuer Bitmaps und MetaFiles
rIStream >> rGraphic;
+
if( rIStream.GetError() )
+ {
nStatus = GRFILTER_FORMATERROR;
+ }
+ else
+ {
+ // #15508# added BMP type (checked, works)
+ eLinkType = GFX_LINK_TYPE_NATIVE_BMP;
+ }
}
else if( aFilterName.EqualsIgnoreCaseAscii( IMP_WMF ) ||
aFilterName.EqualsIgnoreCaseAscii( IMP_EMF ) )
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx
index 7ad3292..3f58d50 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -389,6 +389,10 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry**
switch( const_cast< Graphic* >( mpGraphic )->GetLink().GetType() )
{
case( GFX_LINK_TYPE_NATIVE_GIF ): pMimeType = MIMETYPE_GIF; break;
+
+ // #15508# added BMP type for better exports (checked, works)
+ case( GFX_LINK_TYPE_NATIVE_BMP ): pMimeType = MIMETYPE_BMP; break;
+
case( GFX_LINK_TYPE_NATIVE_JPG ): pMimeType = MIMETYPE_JPG; break;
case( GFX_LINK_TYPE_NATIVE_PNG ): pMimeType = MIMETYPE_PNG; break;
case( GFX_LINK_TYPE_NATIVE_WMF ): pMimeType = MIMETYPE_WMF; break;
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index d6af226..77fcbcc 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -935,6 +935,11 @@ sal_Bool GalleryTheme::InsertGraphic( const Graphic& rGraphic, sal_uIntPtr nInse
{
case( GFX_LINK_TYPE_EPS_BUFFER ): nExportFormat = CVT_SVM; break;
case( GFX_LINK_TYPE_NATIVE_GIF ): nExportFormat = CVT_GIF; break;
+
+ // #15508# added BMP type
+ // could not find/trigger a call to this, but should do no harm
+ case( GFX_LINK_TYPE_NATIVE_BMP ): nExportFormat = CVT_BMP; break;
+
case( GFX_LINK_TYPE_NATIVE_JPG ): nExportFormat = CVT_JPG; break;
case( GFX_LINK_TYPE_NATIVE_PNG ): nExportFormat = CVT_PNG; break;
case( GFX_LINK_TYPE_NATIVE_TIF ): nExportFormat = CVT_TIF; break;
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 5ff20b3..50c46ed 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -719,6 +719,10 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s
{
case( GFX_LINK_TYPE_EPS_BUFFER ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) ); break;
case( GFX_LINK_TYPE_NATIVE_GIF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) ); break;
+
+ // #15508# added BMP type for better exports (checked, works)
+ case( GFX_LINK_TYPE_NATIVE_BMP ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".bmp" ) ); break;
+
case( GFX_LINK_TYPE_NATIVE_JPG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".jpg" ) ); break;
case( GFX_LINK_TYPE_NATIVE_PNG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ); break;
case( GFX_LINK_TYPE_NATIVE_TIF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".tif" ) ); break;
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 3e3346f..2db901d 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -203,6 +203,10 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, String& rFileName,
switch( aGfxLink.GetType() )
{
case( GFX_LINK_TYPE_NATIVE_GIF ): aExt = FORMAT_GIF; break;
+
+ // #15508# added BMP type for better exports (no call/trigger found, prob used in HTML export)
+ case( GFX_LINK_TYPE_NATIVE_BMP ): aExt = FORMAT_BMP; break;
+
case( GFX_LINK_TYPE_NATIVE_JPG ): aExt = FORMAT_JPG; break;
case( GFX_LINK_TYPE_NATIVE_PNG ): aExt = FORMAT_PNG; break;
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index be681ec..c1dbeed 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3629,6 +3629,19 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const S
pGraphicAry = aGraphicLink.GetData();
switch (aGraphicLink.GetType())
{
+ // #15508# trying to add BMP type for better exports, need to check if this works
+ // checked, does not work. Also need to reset pGraphicAry to NULL to force conversion
+ // to PNG, else the BMP array will be used.
+ // It may work using direct DIB data, but that needs to be checked eventually
+ //
+ // #15508# before GFX_LINK_TYPE_NATIVE_BMP was added the graphic data
+ // (to be hold in pGraphicAry) was not available; thus for now to stay
+ // compatible, keep it that way by assigning NULL value to pGraphicAry
+ case GFX_LINK_TYPE_NATIVE_BMP:
+ // pBLIPType = OOO_STRING_SVTOOLS_RTF_WBITMAP;
+ pGraphicAry = 0;
+ break;
+
case GFX_LINK_TYPE_NATIVE_JPG:
pBLIPType = OOO_STRING_SVTOOLS_RTF_JPEGBLIP;
break;
diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx
index 48a0d40..8b7cbcc 100644
--- a/sw/source/ui/docvw/romenu.cxx
+++ b/sw/source/ui/docvw/romenu.cxx
@@ -381,6 +381,10 @@ static void lcl_GetPreferedExtension( String &rExt, const Graphic &rGrf )
switch( const_cast<Graphic&>(rGrf).GetLink().GetType() )
{
case GFX_LINK_TYPE_NATIVE_GIF: pExt = "gif"; break;
+
+ // #15508# added BMP type for better exports (writer export graphic - checked, works)
+ case GFX_LINK_TYPE_NATIVE_BMP: pExt = "bmp"; break;
+
case GFX_LINK_TYPE_NATIVE_TIF: pExt = "tif"; break;
case GFX_LINK_TYPE_NATIVE_WMF: pExt = "wmf"; break;
case GFX_LINK_TYPE_NATIVE_MET: pExt = "met"; break;
diff --git a/vcl/inc/vcl/gfxlink.hxx b/vcl/inc/vcl/gfxlink.hxx
index b3766c1..6aeb125 100644
--- a/vcl/inc/vcl/gfxlink.hxx
+++ b/vcl/inc/vcl/gfxlink.hxx
@@ -106,11 +106,15 @@ enum GfxLinkType
GFX_LINK_TYPE_NATIVE_MET = 7, // Don't forget to update the following defines
GFX_LINK_TYPE_NATIVE_PCT = 8, // Don't forget to update the following defines
GFX_LINK_TYPE_NATIVE_SVG = 9, // Don't forget to update the following defines
+
+ // #15508# added BMP type support
+ GFX_LINK_TYPE_NATIVE_BMP = 10, // Don't forget to update the following defines
+
GFX_LINK_TYPE_USER = 0xffff
};
#define GFX_LINK_FIRST_NATIVE_ID GFX_LINK_TYPE_NATIVE_GIF
-#define GFX_LINK_LAST_NATIVE_ID GFX_LINK_TYPE_NATIVE_SVG
+#define GFX_LINK_LAST_NATIVE_ID GFX_LINK_TYPE_NATIVE_BMP
// -----------
// - GfxLink -
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index ed3a686..2bc95c7 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -248,6 +248,10 @@ sal_Bool GfxLink::LoadNative( Graphic& rGraphic )
switch( meType )
{
case( GFX_LINK_TYPE_NATIVE_GIF ): nCvtType = CVT_GIF; break;
+
+ // #15508# added BMP type for better exports (reload when swapped - checked, works)
+ case( GFX_LINK_TYPE_NATIVE_BMP ): nCvtType = CVT_BMP; break;
+
case( GFX_LINK_TYPE_NATIVE_JPG ): nCvtType = CVT_JPG; break;
case( GFX_LINK_TYPE_NATIVE_PNG ): nCvtType = CVT_PNG; break;
case( GFX_LINK_TYPE_NATIVE_TIF ): nCvtType = CVT_TIF; break;
More information about the Libreoffice-commits
mailing list