[Libreoffice-commits] core.git: sd/source sw/inc sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 2 07:34:50 UTC 2020
sd/source/ui/annotations/annotationwindow.cxx | 1
sw/inc/AnnotationWin.hxx | 8 ++--
sw/source/uibase/docvw/AnnotationWin.cxx | 2 -
sw/source/uibase/docvw/AnnotationWin2.cxx | 46 +++++++++++---------------
4 files changed, 26 insertions(+), 31 deletions(-)
New commits:
commit b4513307785ce0d61b3dcde754b1855f1c65225c
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 1 14:34:17 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Sep 2 09:34:07 2020 +0200
annotation label doesn't need to be an Edit, FixedText is enough
similar to:
commit a2d97135411d566b0b1f3d47af7912c8412cee7f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Aug 18 10:23:27 2020 +0100
annotation label doesn't need to be a MultiLine edit, FixedText is enough
Change-Id: I5035ecc2d5d03f7aaeb794006a0cb305bb89a219
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101850
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index 472b9deacd72..e1ee6a9d4347 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -269,6 +269,7 @@ void AnnotationWindow::InitControls()
// window control for author and date
mpMeta = VclPtr<FixedText>::Create(this);
+ mpMeta->EnableRTL(AllSettings::GetLayoutRTL());
mpMeta->SetCallHandlersOnInputDisabled(true);
// we should leave this setting alone, but for this we need a better layout algo
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index 715d01ea95ee..1410ad5d689b 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -39,7 +39,7 @@ class Outliner;
class ScrollBar;
class SwEditWin;
class SwView;
-class Edit;
+class FixedText;
class MenuButton;
class SwFrame;
class SvxLanguageItem;
@@ -229,9 +229,9 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window
VclPtr<sw::sidebarwindows::SidebarTextControl> mpSidebarTextControl;
VclPtr<ScrollBar> mpVScrollbar;
- VclPtr<Edit> mpMetadataAuthor;
- VclPtr<Edit> mpMetadataDate;
- VclPtr<Edit> mpMetadataResolved;
+ VclPtr<FixedText> mpMetadataAuthor;
+ VclPtr<FixedText> mpMetadataDate;
+ VclPtr<FixedText> mpMetadataResolved;
VclPtr<MenuButton> mpMenuButton;
std::unique_ptr<sw::sidebarwindows::AnchorOverlayObject> mpAnchor;
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx
index db719948df8b..926085b31e84 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -26,7 +26,7 @@
#include <uiobject.hxx>
-#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
#include <vcl/menu.hxx>
#include <vcl/scrbar.hxx>
#include <vcl/settings.hxx>
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 10493e45a04a..ee19018d04c9 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -51,7 +51,7 @@
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
-#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
#include <vcl/event.hxx>
#include <vcl/scrbar.hxx>
#include <vcl/svapp.hxx>
@@ -286,7 +286,7 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl
vcl::Font aOrigFont(mpMetadataAuthor->GetControlFont());
Point aPos(PixelToLogic(mpMetadataAuthor->GetPosPixel()));
aPos += rPt;
- vcl::Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetFieldFont() );
+ vcl::Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetLabelFont() );
mpMetadataAuthor->SetControlFont( aFont );
mpMetadataAuthor->Draw(pDev, aPos, nInFlags);
mpMetadataAuthor->SetControlFont( aOrigFont );
@@ -297,7 +297,7 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl
vcl::Font aOrigFont(mpMetadataDate->GetControlFont());
Point aPos(PixelToLogic(mpMetadataDate->GetPosPixel()));
aPos += rPt;
- vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() );
+ vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetLabelFont() );
mpMetadataDate->SetControlFont( aFont );
mpMetadataDate->SetControlFont( aOrigFont );
}
@@ -307,7 +307,7 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl
vcl::Font aOrigFont(mpMetadataResolved->GetControlFont());
Point aPos(PixelToLogic(mpMetadataResolved->GetPosPixel()));
aPos += rPt;
- vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetFieldFont() );
+ vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetLabelFont() );
mpMetadataResolved->SetControlFont( aFont );
mpMetadataResolved->SetControlFont( aOrigFont );
}
@@ -338,7 +338,7 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl
Point aPos(PixelToLogic(mpMenuButton->GetPosPixel()));
aPos += rPt;
- vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() );
+ vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetLabelFont() );
mpMetadataDate->SetControlFont( aFont );
mpMetadataDate->SetControlBackground( Color(0xFFFFFF) );
mpMetadataDate->SetText("...");
@@ -465,11 +465,9 @@ void SwAnnotationWin::InitControls()
mpSidebarTextControl->SetPointer(PointerStyle::Text);
// window controls for author and date
- mpMetadataAuthor = VclPtr<Edit>::Create( this, 0 );
+ mpMetadataAuthor = VclPtr<FixedText>::Create(this);
mpMetadataAuthor->SetAccessibleName( SwResId( STR_ACCESS_ANNOTATION_AUTHOR_NAME ) );
mpMetadataAuthor->EnableRTL(AllSettings::GetLayoutRTL());
- mpMetadataAuthor->SetReadOnly();
- mpMetadataAuthor->AlwaysDisableInput(true);
mpMetadataAuthor->SetCallHandlersOnInputDisabled(true);
mpMetadataAuthor->AddEventListener( LINK( this, SwAnnotationWin, WindowEventListener ) );
// we should leave this setting alone, but for this we need a better layout algo
@@ -477,18 +475,16 @@ void SwAnnotationWin::InitControls()
{
AllSettings aSettings = mpMetadataAuthor->GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- vcl::Font aFont = aStyleSettings.GetFieldFont();
+ vcl::Font aFont = aStyleSettings.GetLabelFont();
aFont.SetFontHeight(8);
- aStyleSettings.SetFieldFont(aFont);
+ aStyleSettings.SetLabelFont(aFont);
aSettings.SetStyleSettings(aStyleSettings);
mpMetadataAuthor->SetSettings(aSettings);
}
- mpMetadataDate = VclPtr<Edit>::Create( this, 0 );
+ mpMetadataDate = VclPtr<FixedText>::Create(this);
mpMetadataDate->SetAccessibleName( SwResId( STR_ACCESS_ANNOTATION_DATE_NAME ) );
mpMetadataDate->EnableRTL(AllSettings::GetLayoutRTL());
- mpMetadataDate->SetReadOnly();
- mpMetadataDate->AlwaysDisableInput(true);
mpMetadataDate->SetCallHandlersOnInputDisabled(true);
mpMetadataDate->AddEventListener( LINK( this, SwAnnotationWin, WindowEventListener ) );
// we should leave this setting alone, but for this we need a better layout algo
@@ -496,18 +492,16 @@ void SwAnnotationWin::InitControls()
{
AllSettings aSettings = mpMetadataDate->GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- vcl::Font aFont = aStyleSettings.GetFieldFont();
+ vcl::Font aFont = aStyleSettings.GetLabelFont();
aFont.SetFontHeight(8);
- aStyleSettings.SetFieldFont(aFont);
+ aStyleSettings.SetLabelFont(aFont);
aSettings.SetStyleSettings(aStyleSettings);
mpMetadataDate->SetSettings(aSettings);
}
- mpMetadataResolved = VclPtr<Edit>::Create( this, 0 );
+ mpMetadataResolved = VclPtr<FixedText>::Create(this);
mpMetadataResolved->SetAccessibleName( SwResId( STR_ACCESS_ANNOTATION_RESOLVED_NAME ) );
mpMetadataResolved->EnableRTL(AllSettings::GetLayoutRTL());
- mpMetadataResolved->SetReadOnly();
- mpMetadataResolved->AlwaysDisableInput(true);
mpMetadataResolved->SetCallHandlersOnInputDisabled(true);
mpMetadataResolved->AddEventListener( LINK( this, SwAnnotationWin, WindowEventListener ) );
// we should leave this setting alone, but for this we need a better layout algo
@@ -515,9 +509,9 @@ void SwAnnotationWin::InitControls()
{
AllSettings aSettings = mpMetadataResolved->GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- vcl::Font aFont = aStyleSettings.GetFieldFont();
+ vcl::Font aFont = aStyleSettings.GetLabelFont();
aFont.SetFontHeight(8);
- aStyleSettings.SetFieldFont(aFont);
+ aStyleSettings.SetLabelFont(aFont);
aSettings.SetStyleSettings(aStyleSettings);
mpMetadataResolved->SetSettings(aSettings);
mpMetadataResolved->SetText( SwResId( STR_ACCESS_ANNOTATION_RESOLVED_NAME ) );
@@ -641,21 +635,21 @@ void SwAnnotationWin::Rescale()
const Fraction& rFraction = mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY();
if ( mpMetadataAuthor )
{
- vcl::Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetFieldFont() );
+ vcl::Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetLabelFont() );
sal_Int32 nHeight = long(aFont.GetFontHeight() * rFraction);
aFont.SetFontHeight( nHeight );
mpMetadataAuthor->SetControlFont( aFont );
}
if ( mpMetadataDate )
{
- vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() );
+ vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetLabelFont() );
sal_Int32 nHeight = long(aFont.GetFontHeight() * rFraction);
aFont.SetFontHeight( nHeight );
mpMetadataDate->SetControlFont( aFont );
}
if ( mpMetadataResolved )
{
- vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetFieldFont() );
+ vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetLabelFont() );
sal_Int32 nHeight = long(aFont.GetFontHeight() * rFraction);
aFont.SetFontHeight( nHeight );
mpMetadataResolved->SetControlFont( aFont );
@@ -1041,7 +1035,7 @@ void SwAnnotationWin::SetColor(Color aColorDark,Color aColorLight, Color aColorA
mpMetadataAuthor->SetControlBackground(mColorDark);
AllSettings aSettings = mpMetadataAuthor->GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- aStyleSettings.SetFieldTextColor(aColorAnchor);
+ aStyleSettings.SetLabelTextColor(aColorAnchor);
aSettings.SetStyleSettings(aStyleSettings);
mpMetadataAuthor->SetSettings(aSettings);
}
@@ -1050,7 +1044,7 @@ void SwAnnotationWin::SetColor(Color aColorDark,Color aColorLight, Color aColorA
mpMetadataDate->SetControlBackground(mColorDark);
AllSettings aSettings = mpMetadataDate->GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- aStyleSettings.SetFieldTextColor(aColorAnchor);
+ aStyleSettings.SetLabelTextColor(aColorAnchor);
aSettings.SetStyleSettings(aStyleSettings);
mpMetadataDate->SetSettings(aSettings);
}
@@ -1059,7 +1053,7 @@ void SwAnnotationWin::SetColor(Color aColorDark,Color aColorLight, Color aColorA
mpMetadataResolved->SetControlBackground(mColorDark);
AllSettings aSettings = mpMetadataResolved->GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- aStyleSettings.SetFieldTextColor(aColorAnchor);
+ aStyleSettings.SetLabelTextColor(aColorAnchor);
aSettings.SetStyleSettings(aStyleSettings);
mpMetadataResolved->SetSettings(aSettings);
}
More information about the Libreoffice-commits
mailing list