[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - include/vcl vcl/source
Caolán McNamara
caolanm at redhat.com
Mon Jun 24 06:12:58 PDT 2013
include/vcl/vclmedit.hxx | 2 ++
vcl/source/edit/vclmedit.cxx | 12 ++++++++++++
vcl/source/window/layout.cxx | 2 ++
3 files changed, 16 insertions(+)
New commits:
commit bf69b76ee8e16069ca6d6a1782e7610ef784aa4b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 4 16:13:06 2013 +0100
Related: fdo#66105 clip message box dialogs to some reasonable widths
(cherry picked from commit 19a2685ec04bd6ce882d4dd08d24c7248cf99a84)
Change-Id: I7fc179865306ba5b593b090b1fdb8971ba6bd508
Reviewed-on: https://gerrit.libreoffice.org/4480
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
diff --git a/include/vcl/vclmedit.hxx b/include/vcl/vclmedit.hxx
index 63caa3b..e3fdfc5 100644
--- a/include/vcl/vclmedit.hxx
+++ b/include/vcl/vclmedit.hxx
@@ -81,6 +81,8 @@ public:
virtual void SetMaxTextLen( xub_StrLen nMaxLen = 0 );
virtual xub_StrLen GetMaxTextLen() const;
+ void SetMaxTextWidth( sal_uLong nMaxWidth );
+
virtual void SetSelection( const Selection& rSelection );
virtual const Selection& GetSelection() const;
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index b83be1d..79d8399 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -115,6 +115,8 @@ public:
void SetMaxTextLen( xub_StrLen nLen );
xub_StrLen GetMaxTextLen() const;
+ void SetMaxTextWidth( sal_uLong nMaxWidth );
+
sal_Bool IsInsertMode() const;
void InsertText( const String& rStr );
@@ -400,6 +402,11 @@ String ImpVclMEdit::GetSelected( LineEnd aSeparator ) const
return mpTextWindow->GetTextView()->GetSelected( aSeparator );
}
+void ImpVclMEdit::SetMaxTextWidth( sal_uLong nMaxWidth )
+{
+ mpTextWindow->GetTextEngine()->SetMaxTextWidth( nMaxWidth );
+}
+
void ImpVclMEdit::Resize()
{
size_t nIteration = 1;
@@ -1113,6 +1120,11 @@ void VclMultiLineEdit::SetMaxTextLen( xub_StrLen nMaxLen )
pImpVclMEdit->SetMaxTextLen( nMaxLen );
}
+void VclMultiLineEdit::SetMaxTextWidth( sal_uLong nMaxWidth )
+{
+ pImpVclMEdit->SetMaxTextWidth(nMaxWidth );
+}
+
xub_StrLen VclMultiLineEdit::GetMaxTextLen() const
{
return pImpVclMEdit->GetMaxTextLen();
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 4714f1e..33977c2 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1783,6 +1783,7 @@ short MessageDialog::Execute()
m_pPrimaryMessage->set_hexpand(true);
m_pPrimaryMessage->SetText(m_sPrimaryString);
m_pPrimaryMessage->Show(!m_sPrimaryString.isEmpty());
+ m_pPrimaryMessage->SetMaxTextWidth(m_pPrimaryMessage->approximate_char_width() * 60);
m_pSecondaryMessage = new VclMultiLineEdit(m_pGrid, nWinStyle);
m_pSecondaryMessage->SetPaintTransparent(true);
@@ -1792,6 +1793,7 @@ short MessageDialog::Execute()
m_pSecondaryMessage->set_hexpand(true);
m_pSecondaryMessage->SetText(m_sSecondaryString);
m_pSecondaryMessage->Show(!m_sSecondaryString.isEmpty());
+ m_pSecondaryMessage->SetMaxTextWidth(m_pPrimaryMessage->approximate_char_width() * 80);
m_pGrid->Show();
More information about the Libreoffice-commits
mailing list