Kaydet (Commit) 5fce6efe authored tarafından Tamás Zolnai's avatar Tamás Zolnai

Unfloat: FloatingTableButton -> UnfloatTableButton

It explains better, what this button is.

Change-Id: I93b78c7907686179ec4fe6b3f45daa15c846c316
Reviewed-on: https://gerrit.libreoffice.org/65942
Tested-by: Jenkins
Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 7809ec85
......@@ -607,7 +607,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/uibase/docvw/AnnotationWin2 \
sw/source/uibase/docvw/DashedLine \
sw/source/uibase/docvw/FrameControlsManager \
sw/source/uibase/docvw/FloatingTableButton \
sw/source/uibase/docvw/UnfloatTableButton \
sw/source/uibase/docvw/PageBreakWin \
sw/source/uibase/docvw/OverlayRanges \
sw/source/uibase/docvw/PostItMgr \
......
......@@ -1868,7 +1868,7 @@ void SwFlyFrame::UpdateUnfloatButton(SwWrtShell* pWrtSh, bool bShow) const
SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin();
SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager();
Point aBottomRightPixel = rEditWin.LogicToPixel( getFrameArea().BottomRight() );
rMngr.SetFloatingTableButton(this, bShow, aBottomRightPixel);
rMngr.SetUnfloatTableButton(this, bShow, aBottomRightPixel);
}
SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst )
......
......@@ -11,7 +11,7 @@
#include <FrameControlsManager.hxx>
#include <HeaderFooterWin.hxx>
#include <PageBreakWin.hxx>
#include <FloatingTableButton.hxx>
#include <UnfloatTableButton.hxx>
#include <pagefrm.hxx>
#include <flyfrm.hxx>
#include <viewopt.hxx>
......@@ -139,7 +139,7 @@ void SwFrameControlsManager::SetPageBreakControl( const SwPageFrame* pPageFrame
pControl->ShowAll( true );
}
void SwFrameControlsManager::SetFloatingTableButton( const SwFlyFrame* pFlyFrame, bool bShow, Point aBottomRightPixel )
void SwFrameControlsManager::SetUnfloatTableButton( const SwFlyFrame* pFlyFrame, bool bShow, Point aBottomRightPixel )
{
if(pFlyFrame == nullptr)
return;
......@@ -157,7 +157,7 @@ void SwFrameControlsManager::SetFloatingTableButton( const SwFlyFrame* pFlyFrame
else
{
SwFrameControlPtr pNewControl( new SwFrameControl(
VclPtr<FloatingTableButton>::Create( m_pEditWin, pFlyFrame ).get() ) );
VclPtr<UnfloatTableButton>::Create( m_pEditWin, pFlyFrame ).get() ) );
const SwViewOption* pViewOpt = m_pEditWin->GetView().GetWrtShell().GetViewOptions();
pNewControl->SetReadonly( pViewOpt->IsReadonly() );
......@@ -166,7 +166,7 @@ void SwFrameControlsManager::SetFloatingTableButton( const SwFlyFrame* pFlyFrame
pControl.swap( pNewControl );
}
FloatingTableButton* pButton = dynamic_cast<FloatingTableButton*>(pControl->GetWindow());
UnfloatTableButton* pButton = dynamic_cast<UnfloatTableButton*>(pControl->GetWindow());
assert(pButton != nullptr);
pButton->SetOffset(aBottomRightPixel);
pControl->ShowAll( bShow );
......
......@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <FloatingTableButton.hxx>
#include <UnfloatTableButton.hxx>
#include <HeaderFooterWin.hxx>
#include <edtwin.hxx>
......@@ -36,15 +36,15 @@
#define BOX_DISTANCE 3
#define BUTTON_WIDTH 12
FloatingTableButton::FloatingTableButton(SwEditWin* pEditWin, const SwFrame* pFrame)
UnfloatTableButton::UnfloatTableButton(SwEditWin* pEditWin, const SwFrame* pFrame)
: SwFrameMenuButtonBase(pEditWin, pFrame)
, m_sLabel(SwResId(STR_UNFLOAT_TABLE))
{
}
FloatingTableButton::~FloatingTableButton() { disposeOnce(); }
UnfloatTableButton::~UnfloatTableButton() { disposeOnce(); }
void FloatingTableButton::SetOffset(Point aBottomRightPixel)
void UnfloatTableButton::SetOffset(Point aBottomRightPixel)
{
// Compute the text size and get the box position & size from it
tools::Rectangle aTextRect;
......@@ -66,7 +66,7 @@ void FloatingTableButton::SetOffset(Point aBottomRightPixel)
SetPosSizePixel(aBoxPos, aBoxSize);
}
void FloatingTableButton::MouseButtonDown(const MouseEvent& /*rMEvt*/)
void UnfloatTableButton::MouseButtonDown(const MouseEvent& /*rMEvt*/)
{
assert(GetFrame()->IsFlyFrame());
// const_cast is needed because of bad design of ISwFrameControl and derived classes
......@@ -122,7 +122,7 @@ void FloatingTableButton::MouseButtonDown(const MouseEvent& /*rMEvt*/)
}
}
void FloatingTableButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
void UnfloatTableButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
SetMapMode(MapMode(MapUnit::MapPixel));
drawinglayer::primitive2d::Primitive2DContainer aSeq;
......@@ -162,9 +162,9 @@ void FloatingTableButton::Paint(vcl::RenderContext& rRenderContext, const tools:
pProcessor->process(aSeq);
}
void FloatingTableButton::ShowAll(bool bShow) { Show(bShow); }
void UnfloatTableButton::ShowAll(bool bShow) { Show(bShow); }
bool FloatingTableButton::Contains(const Point& rDocPt) const
bool UnfloatTableButton::Contains(const Point& rDocPt) const
{
::tools::Rectangle aRect(GetPosPixel(), GetSizePixel());
if (aRect.IsInside(rDocPt))
......@@ -173,6 +173,6 @@ bool FloatingTableButton::Contains(const Point& rDocPt) const
return false;
}
void FloatingTableButton::SetReadonly(bool bReadonly) { ShowAll(!bReadonly); }
void UnfloatTableButton::SetReadonly(bool bReadonly) { ShowAll(!bReadonly); }
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
......@@ -47,7 +47,7 @@ class SwFrameControlsManager
// Helper methods
void SetHeaderFooterControl( const SwPageFrame* pPageFrame, FrameControlType eType, Point aOffset );
void SetPageBreakControl( const SwPageFrame* pPageFrame );
void SetFloatingTableButton( const SwFlyFrame* pFlyFrame, bool bShow, Point aTopLeftPixel = Point() );
void SetUnfloatTableButton( const SwFlyFrame* pFlyFrame, bool bShow, Point aTopLeftPixel = Point() );
};
#endif
......
......@@ -7,13 +7,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SW_SOURCE_UIBASE_DOCVW_FLOATINGTABLEBUTTON_HXX
#define INCLUDED_SW_SOURCE_UIBASE_DOCVW_FLOATINGTABLEBUTTON_HXX
#ifndef INCLUDED_SW_SOURCE_UIBASE_DOCVW_UNFLOATTABLEBUTTON_HXX
#define INCLUDED_SW_SOURCE_UIBASE_DOCVW_UNFLOATTABLEBUTTON_HXX
#include "FrameControl.hxx"
#include <vcl/menubtn.hxx>
/** Class for unfloat table button
*
* This unfloat button is used to convert a floating table into a simple writer table embedded to the text body.
......@@ -23,13 +22,13 @@
* floating properties.
*
*/
class FloatingTableButton : public SwFrameMenuButtonBase
class UnfloatTableButton : public SwFrameMenuButtonBase
{
OUString m_sLabel;
public:
FloatingTableButton(SwEditWin* pEditWin, const SwFrame* pFrame);
virtual ~FloatingTableButton() override;
UnfloatTableButton(SwEditWin* pEditWin, const SwFrame* pFrame);
virtual ~UnfloatTableButton() override;
void SetOffset(Point aBottomRightPixel);
......@@ -44,4 +43,4 @@ public:
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
\ No newline at end of file
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment