[Libreoffice-commits] core.git: 4 commits - cui/source include/svtools include/svx include/vcl sd/source slideshow/source svx/source vcl/inc vcl/source
Caolán McNamara
caolanm at redhat.com
Thu Jul 27 12:33:48 UTC 2017
cui/source/inc/textanim.hxx | 5 +
cui/source/tabpages/textanim.cxx | 31 +++++-----
include/svtools/grfmgr.hxx | 2
include/svx/colorbox.hxx | 8 +-
include/vcl/animate.hxx | 8 +-
include/vcl/button.hxx | 4 -
include/vcl/graph.hxx | 2
include/vcl/vclmedit.hxx | 2
sd/source/ui/dlg/animobjs.cxx | 8 +-
slideshow/source/engine/shapes/drawshape.hxx | 2
slideshow/source/engine/shapes/gdimtftools.cxx | 2
slideshow/source/engine/shapes/gdimtftools.hxx | 6 -
slideshow/source/engine/shapes/intrinsicanimationactivity.cxx | 2
slideshow/source/engine/shapes/intrinsicanimationactivity.hxx | 2
svx/source/tbxctrls/tbcontrl.cxx | 10 ---
vcl/inc/impgraph.hxx | 2
vcl/source/control/button.cxx | 1
vcl/source/edit/vclmedit.cxx | 8 +-
vcl/source/gdi/animate.cxx | 4 -
vcl/source/gdi/graph.cxx | 2
vcl/source/gdi/impgraph.cxx | 5 -
21 files changed, 55 insertions(+), 61 deletions(-)
New commits:
commit 81047eaebc0e25ff926bf944c57e082a8727c7f2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jul 27 12:26:38 2017 +0100
make animation loop sal_uInt32 consistently
all this foo is ultimately animated gifs and the count there is
limited to unsigned 16bit
Change-Id: Ib6e6dde7355f3619bb7735743e686e6338a235ee
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index a6339128c479..4edde4dcb503 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -186,7 +186,7 @@ private:
OUString maUserData;
std::unique_ptr<Timer> mxSwapOutTimer;
std::unique_ptr<GrfSimpleCacheObj> mxSimpleCache;
- sal_uLong mnAnimationLoopCount;
+ sal_uInt32 mnAnimationLoopCount;
// a unique increasing ID to be able to say which data change is older
sal_uLong mnDataChangeTimeStamp;
diff --git a/include/vcl/animate.hxx b/include/vcl/animate.hxx
index 119499629d36..bb8cc968c3ac 100644
--- a/include/vcl/animate.hxx
+++ b/include/vcl/animate.hxx
@@ -118,8 +118,8 @@ public:
const BitmapEx& GetBitmapEx() const { return maBitmapEx; }
void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; }
- sal_uLong GetLoopCount() const { return mnLoopCount; }
- void SetLoopCount( const sal_uLong nLoopCount );
+ sal_uInt32 GetLoopCount() const { return mnLoopCount; }
+ void SetLoopCount(const sal_uInt32 nLoopCount);
void ResetLoopCount();
void SetNotifyHdl( const Link<Animation*,void>& rLink ) { maNotifyLink = rLink; }
@@ -176,8 +176,8 @@ private:
BitmapEx maBitmapEx;
Timer maTimer;
Size maGlobalSize;
- long mnLoopCount;
- long mnLoops;
+ sal_uInt32 mnLoopCount;
+ sal_uInt32 mnLoops;
size_t mnPos;
bool mbIsInAnimation;
bool mbLoopTerminated;
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index 39fd594e878e..626b11bcddca 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -187,7 +187,7 @@ public:
void SetAnimationNotifyHdl( const Link<Animation*,void>& rLink );
Link<Animation*,void> GetAnimationNotifyHdl() const;
- sal_uLong GetAnimationLoopCount() const;
+ sal_uInt32 GetAnimationLoopCount() const;
BitmapChecksum GetChecksum() const;
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 4388395321d9..2ef96aa2de1c 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -744,7 +744,7 @@ void AnimationWindow::AddObj (::sd::View& rView )
// LoopCount
if( i == 0 )
{
- long nLoopCount = aAnimation.GetLoopCount();
+ sal_uInt32 nLoopCount = aAnimation.GetLoopCount();
if( !nLoopCount ) // endless
m_pLbLoopCount->SelectEntryPos( m_pLbLoopCount->GetEntryCount() - 1);
@@ -980,11 +980,11 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
// find LoopCount (number of passes)
AnimationBitmap aAnimBmp;
- long nLoopCount = 0L;
- sal_Int32 nPos = m_pLbLoopCount->GetSelectEntryPos();
+ sal_uInt32 nLoopCount = 0;
+ sal_Int32 nPos = m_pLbLoopCount->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND && nPos != m_pLbLoopCount->GetEntryCount() - 1 ) // endless
- nLoopCount = (long) m_pLbLoopCount->GetSelectEntry().toInt32();
+ nLoopCount = m_pLbLoopCount->GetSelectEntry().toUInt32();
aAnimBmp.aBmpEx = *pBitmapEx;
aAnimBmp.aPosPix = aPt;
diff --git a/slideshow/source/engine/shapes/drawshape.hxx b/slideshow/source/engine/shapes/drawshape.hxx
index 7fb7cc225667..924727577e01 100644
--- a/slideshow/source/engine/shapes/drawshape.hxx
+++ b/slideshow/source/engine/shapes/drawshape.hxx
@@ -337,7 +337,7 @@ namespace slideshow
int mnIsAnimatedCount;
/// Number of times the bitmap animation shall loop
- ::std::size_t mnAnimationLoopCount;
+ sal_uInt32 mnAnimationLoopCount;
/// Whether shape is visible (without attribute layers)
bool mbIsVisible;
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx
index 5cdd8d0095ed..3d7e643dfb7b 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -263,7 +263,7 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct )
}
bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
- ::std::size_t& o_rLoopCount,
+ sal_uInt32& o_rLoopCount,
const Graphic& rGraphic )
{
o_rFrames.clear();
diff --git a/slideshow/source/engine/shapes/gdimtftools.hxx b/slideshow/source/engine/shapes/gdimtftools.hxx
index 861d3528ffa8..ac3989772e2f 100644
--- a/slideshow/source/engine/shapes/gdimtftools.hxx
+++ b/slideshow/source/engine/shapes/gdimtftools.hxx
@@ -112,9 +112,9 @@ namespace slideshow
@param rGraphic
Input graphic object, to extract animations from
*/
- bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
- ::std::size_t& o_rLoopCount,
- const Graphic& rGraphic );
+ bool getAnimationFromGraphic(VectorOfMtfAnimationFrames& o_rFrames,
+ sal_uInt32& o_rLoopCount,
+ const Graphic& rGraphic);
/** Retrieve scroll text animation rectangles from given metafile
diff --git a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
index 15aca7471c0f..04016826e110 100644
--- a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
+++ b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
@@ -237,7 +237,7 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts,
- ::std::size_t nNumLoops )
+ sal_uInt32 nNumLoops)
{
return ActivitySharedPtr(
new IntrinsicAnimationActivity(rContext,
diff --git a/slideshow/source/engine/shapes/intrinsicanimationactivity.hxx b/slideshow/source/engine/shapes/intrinsicanimationactivity.hxx
index 628a458cb728..c19c393a498d 100644
--- a/slideshow/source/engine/shapes/intrinsicanimationactivity.hxx
+++ b/slideshow/source/engine/shapes/intrinsicanimationactivity.hxx
@@ -60,7 +60,7 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts,
- ::std::size_t nNumLoops );
+ sal_uInt32 nNumLoops);
}
}
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index f5982f84cb2d..1dc5adc30ab5 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -115,7 +115,7 @@ private:
void ImplSetAnimationNotifyHdl( const Link<Animation*,void>& rLink );
Link<Animation*,void> ImplGetAnimationNotifyHdl() const;
- sal_uLong ImplGetAnimationLoopCount() const;
+ sal_uInt32 ImplGetAnimationLoopCount() const;
private:
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index b7f335628aef..6b96cb971eca 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -510,7 +510,7 @@ void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16
}
}
-void Animation::SetLoopCount( const sal_uLong nLoopCount )
+void Animation::SetLoopCount(const sal_uInt32 nLoopCount)
{
mnLoopCount = nLoopCount;
ResetLoopCount();
@@ -767,7 +767,7 @@ SvStream& ReadAnimation( SvStream& rIStm, Animation& rAnimation )
rIStm.ReadUInt16( nTmp16 ); aAnimBmp.nWait = ( ( 65535 == nTmp16 ) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16 );
rIStm.ReadUInt16( nTmp16 ); aAnimBmp.eDisposal = ( Disposal) nTmp16;
rIStm.ReadCharAsBool( cTmp ); aAnimBmp.bUserInput = cTmp;
- rIStm.ReadUInt32( nTmp32 ); rAnimation.mnLoopCount = (sal_uInt16) nTmp32;
+ rIStm.ReadUInt32( rAnimation.mnLoopCount );
rIStm.ReadUInt32( nTmp32 ); // Unused
rIStm.ReadUInt32( nTmp32 ); // Unused
rIStm.ReadUInt32( nTmp32 ); // Unused
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index b36c5300f4d5..6452e08660fa 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -484,7 +484,7 @@ Link<Animation*,void> Graphic::GetAnimationNotifyHdl() const
return mxImpGraphic->ImplGetAnimationNotifyHdl();
}
-sal_uLong Graphic::GetAnimationLoopCount() const
+sal_uInt32 Graphic::GetAnimationLoopCount() const
{
return mxImpGraphic->ImplGetAnimationLoopCount();
}
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index e782e71ebff3..812e504880ab 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -947,12 +947,11 @@ Link<Animation*,void> ImpGraphic::ImplGetAnimationNotifyHdl() const
return aLink;
}
-sal_uLong ImpGraphic::ImplGetAnimationLoopCount() const
+sal_uInt32 ImpGraphic::ImplGetAnimationLoopCount() const
{
- return( mpAnimation ? mpAnimation->GetLoopCount() : 0UL );
+ return( mpAnimation ? mpAnimation->GetLoopCount() : 0 );
}
-
void ImpGraphic::ImplSetContext( const std::shared_ptr<GraphicReader>& pReader )
{
mpContext = pReader;
commit ae11dafc89a1f748233500ea0fd89cff4ef7378c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jul 27 12:05:50 2017 +0100
align ImpVclMEdit::SetMaxTextWidth arg with TextEngine::SetMaxTextWidth
Change-Id: I7cc7531d6a1770edd8b644c6958b91275a53dd84
diff --git a/include/vcl/vclmedit.hxx b/include/vcl/vclmedit.hxx
index f792a4681abc..c494cdff3420 100644
--- a/include/vcl/vclmedit.hxx
+++ b/include/vcl/vclmedit.hxx
@@ -85,7 +85,7 @@ public:
virtual void SetMaxTextLen(sal_Int32 nMaxLen) override;
virtual sal_Int32 GetMaxTextLen() const override;
- void SetMaxTextWidth( sal_uLong nMaxWidth );
+ void SetMaxTextWidth(long nMaxWidth);
virtual void SetSelection( const Selection& rSelection ) override;
virtual const Selection& GetSelection() const override;
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index de47bad4b50e..759bef4e6a68 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -107,7 +107,7 @@ public:
void SetMaxTextLen(sal_Int32 nLen);
sal_Int32 GetMaxTextLen() const;
- void SetMaxTextWidth( sal_uLong nMaxWidth );
+ void SetMaxTextWidth(long nMaxWidth);
void InsertText( const OUString& rStr );
OUString GetSelected() const;
@@ -390,9 +390,9 @@ OUString ImpVclMEdit::GetSelected( LineEnd aSeparator ) const
return mpTextWindow->GetTextView()->GetSelected( aSeparator );
}
-void ImpVclMEdit::SetMaxTextWidth( sal_uLong nMaxWidth )
+void ImpVclMEdit::SetMaxTextWidth(long nMaxWidth)
{
- mpTextWindow->GetTextEngine()->SetMaxTextWidth( nMaxWidth );
+ mpTextWindow->GetTextEngine()->SetMaxTextWidth(nMaxWidth);
}
void ImpVclMEdit::Resize()
@@ -1168,7 +1168,7 @@ void VclMultiLineEdit::SetMaxTextLen(sal_Int32 nMaxLen)
pImpVclMEdit->SetMaxTextLen(nMaxLen);
}
-void VclMultiLineEdit::SetMaxTextWidth( sal_uLong nMaxWidth )
+void VclMultiLineEdit::SetMaxTextWidth(long nMaxWidth)
{
pImpVclMEdit->SetMaxTextWidth(nMaxWidth );
}
commit 39fd7e97c253153a10161ef3694b64e90e65e80a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jul 27 11:56:29 2017 +0100
Resolves: tdf#109289 add SvxColorListBox::IsValueChangedFromSaved
and remove PushButton::IsValueChangedFromSaved
Change-Id: Ib1c51e27fd708c5d4811c90ef5659b4d55dd8860
diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx
index a813d545fb01..e2cb74962aad 100644
--- a/include/svx/colorbox.hxx
+++ b/include/svx/colorbox.hxx
@@ -35,6 +35,7 @@ private:
Link<SvxColorListBox&, void> m_aSelectedLink;
SvxListBoxColorWrapper m_aColorWrapper;
Color m_aAutoDisplayColor;
+ Color m_aSaveColor;
NamedColor m_aSelectedColor;
sal_uInt16 m_nSlotId;
bool m_bShowNoneButton;
@@ -58,8 +59,8 @@ public:
void SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton = false);
- NamedColor GetSelectEntry() const;
- Color GetSelectEntryColor() const;
+ Color GetSelectEntryColor() const { return m_aSelectedColor.first; }
+ NamedColor GetSelectEntry() const { return m_aSelectedColor; }
void SelectEntry(const NamedColor& rColor);
void SelectEntry(const Color& rColor);
@@ -70,6 +71,9 @@ public:
void SetAutoDisplayColor(const Color &rColor) { m_aAutoDisplayColor = rColor; }
void ShowPreview(const NamedColor &rColor);
void EnsurePaletteManager();
+
+ void SaveValue() { m_aSaveColor = GetSelectEntryColor(); }
+ bool IsValueChangedFromSaved() const { return m_aSaveColor != GetSelectEntryColor(); }
};
/** A wrapper for SvxColorListBox. */
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 6de11784086d..3ec0d467bf85 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -157,9 +157,6 @@ public:
void EndSelection();
- void SaveValue() { meSaveValue = GetState(); }
- bool IsValueChangedFromSaved() const { return meSaveValue != GetState(); }
-
Size CalcMinimumSize() const;
virtual Size GetOptimalSize() const override;
@@ -200,7 +197,6 @@ protected:
private:
SymbolType meSymbol;
TriState meState;
- TriState meSaveValue;
bool mbPressed;
};
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 0050682096f3..4908ecb1d577 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3382,16 +3382,6 @@ void SvxColorListBox::SelectEntry(const Color& rColor)
ShowPreview(m_aSelectedColor);
}
-Color SvxColorListBox::GetSelectEntryColor() const
-{
- return m_aSelectedColor.first;
-}
-
-NamedColor SvxColorListBox::GetSelectEntry() const
-{
- return m_aSelectedColor;
-}
-
SvxColorListBoxWrapper::SvxColorListBoxWrapper(SvxColorListBox& rListBox)
: sfx::SingleControlWrapper<SvxColorListBox, Color>(rListBox)
{
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index bf0432c2e143..b97809572d62 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -622,7 +622,6 @@ void PushButton::ImplInitPushButtonData()
meSymbol = SymbolType::DONTKNOW;
meState = TRISTATE_FALSE;
- meSaveValue = TRISTATE_FALSE;
mnDDStyle = PushButtonDropdownStyle::NONE;
mbIsActive = false;
mbPressed = false;
commit 247607727986df0fd0fef198459eb6646e056ea3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jul 27 11:54:28 2017 +0100
Related: tdf#109289 move PushButton::IsValueChangedFromSaved to consumer
inheriting the IsValueChangedFromSaved from PushButton has allowed
undesirable behaviour to be selected
Change-Id: Ifccb1657d2565005e6f9e239c6118f2e5ae7970c
diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx
index 9b4a635d4568..37ff6561b9e3 100644
--- a/cui/source/inc/textanim.hxx
+++ b/cui/source/inc/textanim.hxx
@@ -74,6 +74,11 @@ private:
void SelectDirection( SdrTextAniDirection nValue );
sal_uInt16 GetSelectedDirection();
+ TriState m_aUpState;
+ TriState m_aLeftState;
+ TriState m_aRightState;
+ TriState m_aDownState;
+
public:
SvxTextAnimationPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
virtual ~SvxTextAnimationPage() override;
diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx
index fbf8302b6a47..4670e462f455 100644
--- a/cui/source/tabpages/textanim.cxx
+++ b/cui/source/tabpages/textanim.cxx
@@ -88,13 +88,14 @@ void SvxTextTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
|*
\************************************************************************/
-SvxTextAnimationPage::SvxTextAnimationPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs ) :
- SfxTabPage ( pWindow
- ,"TextAnimation"
- ,"cui/ui/textanimtabpage.ui"
- ,&rInAttrs ),
- rOutAttrs ( rInAttrs ),
- eAniKind ( SdrTextAniKind::NONE )
+SvxTextAnimationPage::SvxTextAnimationPage(vcl::Window* pWindow, const SfxItemSet& rInAttrs)
+ : SfxTabPage(pWindow, "TextAnimation", "cui/ui/textanimtabpage.ui", &rInAttrs)
+ , rOutAttrs(rInAttrs)
+ , eAniKind(SdrTextAniKind::NONE)
+ , m_aUpState(TRISTATE_INDET)
+ , m_aLeftState(TRISTATE_INDET)
+ , m_aRightState(TRISTATE_INDET)
+ , m_aDownState(TRISTATE_INDET)
{
get(m_pLbEffect, "LB_EFFECT");
get(m_pBoxDirection,"boxDIRECTION");
@@ -200,10 +201,10 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
m_pBtnRight->Check( false );
m_pBtnDown->Check( false );
}
- m_pBtnUp->SaveValue();
- m_pBtnLeft->SaveValue();
- m_pBtnRight->SaveValue();
- m_pBtnDown->SaveValue();
+ m_aUpState = m_pBtnUp->GetState();
+ m_aLeftState = m_pBtnLeft->GetState();
+ m_aRightState = m_pBtnRight->GetState();
+ m_aDownState = m_pBtnDown->GetState();
// Start inside
pItem = GetItem( *rAttrs, SDRATTR_TEXT_ANISTARTINSIDE );
@@ -375,10 +376,10 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs)
}
// animation direction
- if( m_pBtnUp->IsValueChangedFromSaved() ||
- m_pBtnLeft->IsValueChangedFromSaved() ||
- m_pBtnRight->IsValueChangedFromSaved() ||
- m_pBtnDown->IsValueChangedFromSaved() )
+ if (m_aUpState != m_pBtnUp->GetState() ||
+ m_aLeftState != m_pBtnLeft->GetState() ||
+ m_aRightState != m_pBtnRight->GetState() ||
+ m_aDownState != m_pBtnDown->GetState())
{
SdrTextAniDirection eValue = (SdrTextAniDirection) GetSelectedDirection();
rAttrs->Put( SdrTextAniDirectionItem( eValue ) );
More information about the Libreoffice-commits
mailing list