[Libreoffice-commits] core.git: 3 commits - cui/source
Caolán McNamara
caolanm at redhat.com
Wed Jul 9 05:56:47 PDT 2014
cui/source/options/optaboutconfig.cxx | 42 +++++++++++++++++++++-------------
cui/source/options/optaboutconfig.hxx | 12 +++------
cui/source/options/optpath.cxx | 4 +--
3 files changed, 32 insertions(+), 26 deletions(-)
New commits:
commit 877aa0e1e879b057027029c1ceed07f90b00b0d3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jul 9 13:46:00 2014 +0100
Resolves: fdo#73806 reduce the size-request of the expert config dialog
the optimal size was set to be 1024x800, reduce this down to
effectively the same size as the options dialog itself.
This dialog just isn't ever going to be right given the huge
length of the strings and the number of strings. We need
something more like a file picker dialog view here
Change-Id: I019e951601c3df769a609b8b439b535b6d5e254f
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 9825645..e918c8a 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -124,21 +124,16 @@ Size CuiCustomMultilineEdit::GetOptimalSize() const
return LogicToPixel(Size(150, GetTextHeight()), MAP_APPFONT);
}
-Size CuiAboutConfigTabPage::GetOptimalSize() const
-{
- return LogicToPixel(Size(1024,800),MAP_APPFONT);
-}
-
CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent/*, const SfxItemSet& rItemSet*/ ) :
ModelessDialog( pParent, "AboutConfig", "cui/ui/aboutconfigdialog.ui"),
m_pPrefCtrl( get<SvSimpleTableContainer>("preferences") ),
m_pResetBtn( get<PushButton>("reset") ),
m_pEditBtn( get<PushButton>("edit") ),
m_vectorOfModified(),
- m_pPrefBox( new OptHeaderTabListBox( *m_pPrefCtrl,
- WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) )
+ m_pPrefBox( new SvSimpleTable(*m_pPrefCtrl,
+ WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) )
{
- Size aControlSize(200,200);
+ Size aControlSize(LogicToPixel(Size(385, 230), MAP_APPFONT));
m_pPrefCtrl->set_width_request(aControlSize.Width());
m_pPrefCtrl->set_height_request(aControlSize.Height());
@@ -152,11 +147,14 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent/*, const SfxItemSe
rBar.InsertItem( ITEMID_TYPE, get<FixedText>("type")->GetText(), 0, HIB_LEFT | HIB_VCENTER );
rBar.InsertItem( ITEMID_VALUE, get<FixedText>("value")->GetText(), 0, HIB_LEFT | HIB_VCENTER );
- long aTabs[] = {4,900,50,50,50};//TODO: Not works correctly hardcoded for now.
+ long aTabs[] = {4,0,0,0,0};
+
+ float fWidth = approximate_char_width();
- aTabs[2] += aTabs[1] + rBar.GetTextWidth(rBar.GetItemText(1));
- aTabs[3] += aTabs[2] + 160; //rBar.GetTextWidth(rBar.GetItemText(2));
- aTabs[4] += aTabs[3] + 40; //rBar.GetTextWidth(rBar.GetItemText(3));
+ aTabs[1] = 0;
+ aTabs[2] = aTabs[1] + fWidth * 65;
+ aTabs[3] = aTabs[2] + fWidth * 20;
+ aTabs[4] = aTabs[3] + fWidth * 8;
m_pPrefBox->SetTabs(aTabs, MAP_PIXEL);
}
@@ -174,7 +172,7 @@ void CuiAboutConfigTabPage::InsertEntry(const OUString& rProp, const OUString& r
m_pPrefBox->Insert( pEntry );
}
-void CuiAboutConfigTabPage::Reset(/* const SfxItemSet&*/ )
+void CuiAboutConfigTabPage::Reset()
{
m_pPrefBox->Clear();
@@ -187,7 +185,7 @@ void CuiAboutConfigTabPage::Reset(/* const SfxItemSet&*/ )
m_pPrefBox->SetUpdateMode(true);
}
-bool CuiAboutConfigTabPage::FillItemSet(/* SfxItemSet&*/ )
+bool CuiAboutConfigTabPage::FillItemSet()
{
bool bModified = false;
diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx
index ee42492..e848cc4 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -37,7 +37,6 @@ public:
virtual void KeyInput( const KeyEvent& rKeyEvent ) SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
- //void setBehaviour( bool bNumeric, int nLengthLimit);
};
class CuiAboutConfigTabPage : public ModelessDialog
@@ -48,7 +47,7 @@ private:
PushButton* m_pEditBtn;
std::vector< boost::shared_ptr< Prop_Impl > > m_vectorOfModified;
- boost::scoped_ptr< svx::OptHeaderTabListBox > m_pPrefBox;
+ boost::scoped_ptr< SvSimpleTable > m_pPrefBox;
void AddToModifiedVector( const boost::shared_ptr< Prop_Impl >& rProp );
std::vector< OUString > commaStringToSequence( const OUString& rCommaSepString );
@@ -57,15 +56,12 @@ private:
DECL_LINK( ResetBtnHdl_Impl, void * );
public:
- //static ModalDialog* Create( Window* pParent, const SfxItemSet& rItemset );
- CuiAboutConfigTabPage( Window* pParent/*, const SfxItemSet& rItemSet*/ );
+ CuiAboutConfigTabPage(Window* pParent);
void InsertEntry(const OUString& rProp, const OUString& rStatus, const OUString& rType, const OUString& rValue);
- void Reset(/* const SfxItemSet&*/ );
+ void Reset();
void FillItems(const com::sun::star::uno::Reference<com::sun::star::container::XNameAccess>& xNameAccess);
com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > getConfigAccess( const OUString& sNodePath, bool bUpdate );
- virtual bool FillItemSet( /* SfxItemSet& rSet*/ );
-
- virtual Size GetOptimalSize() const SAL_OVERRIDE;
+ bool FillItemSet();
};
class CuiAboutConfigValueDialog : public ModalDialog
commit 4fd1c9781fb2042eced9ea1b51c8e0b83c603e3a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jul 9 13:44:27 2014 +0100
use define rather than raw numbers
Change-Id: I62802256780abe92f89a8cde066b26353fc3362a
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index fad0d74..b69dbd8 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -228,8 +228,8 @@ SvxPathTabPage::SvxPathTabPage(Window* pParent, const SfxItemSet& rSet)
0,
HIB_LEFT | HIB_VCENTER );
- long nWidth1 = rBar.GetTextWidth(rBar.GetItemText(1));
- long nWidth2 = rBar.GetTextWidth(rBar.GetItemText(2));
+ long nWidth1 = rBar.GetTextWidth(rBar.GetItemText(ITEMID_TYPE));
+ long nWidth2 = rBar.GetTextWidth(rBar.GetItemText(ITEMID_PATH));
long aTabs[] = {3, 0, 0, 0};
aTabs[2] = nWidth1 + 12;
commit 0f9f361311967375cf8e3409ebc7168322641189
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jul 9 11:41:11 2014 +0100
have expert config dialog survive exceptions
Change-Id: I78a8cd4fff8fb134679d2223a379b6eb799d6f05
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 5392ff6..9825645 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -216,8 +216,20 @@ void CuiAboutConfigTabPage::FillItems(const Reference< XNameAccess >& xNameAcces
{
Any aNode = xNameAccess->getByName( seqItems[i] );
- Reference< XNameAccess > xNextNameAccess( aNode, uno::UNO_QUERY );
- if( xNextNameAccess.is() )
+ bool bNotLeaf = false;
+
+ Reference< XNameAccess > xNextNameAccess;
+ try
+ {
+ xNextNameAccess = Reference< XNameAccess >(aNode, uno::UNO_QUERY);
+ bNotLeaf = xNextNameAccess.is();
+ }
+ catch (const RuntimeException& e)
+ {
+ SAL_WARN( "cui.options", "CuiAboutConfigTabPage: exception " << e.Message);
+ }
+
+ if (bNotLeaf)
{
// not leaf node
FillItems( xNextNameAccess );
More information about the Libreoffice-commits
mailing list