summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2014-08-17 20:43:06 +0200
committerThomas Arnhold <thomas@arnhold.org>2014-08-17 20:48:39 +0200
commiteacc9e6bad22525e99e243b3fbb2405a00503bd3 (patch)
tree5419e895fb028e4e34a715a0e5cae4ac9d6758d5 /sfx2
parent61aaf3814c25b229479ede786521786997aa4f0f (diff)
Customproperties: Correctly size Date
Old behavior: 1) Add a property of type "Date". DateField inside Value column uses the full width. 2) Increase the width of the dialog. Now the size of DateField in the Value column only uses the half width. Solution: Set a flag if the current type is of Date. So we can correct the size after a dialog resize action. Change-Id: I915a553b2f69aac1aea0ac5b24536db5709abfae
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 8e160d048310..3f3e9ada8028 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1377,6 +1377,7 @@ CustomPropertyLine::CustomPropertyLine( Window* pParent ) :
m_aEditButton( pParent, SfxResId( SFX_PB_EDIT ), this),
m_aYesNoButton ( pParent, SfxResId( SFX_WIN_PROPERTY_YESNO ) ),
m_aRemoveButton ( pParent, SfxResId( SFX_PB_PROPERTY_REMOVE ), this ),
+ m_bIsDate ( false ),
m_bIsRemoved ( false ),
m_bTypeLostFocus( false )
@@ -1471,11 +1472,15 @@ IMPL_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox*, pBox )
//adjust positions of date and time controls
if ( nType == CUSTOM_TYPE_DATE )
+ {
+ pLine->m_bIsDate = true;
pLine->m_aDateField.SetSizePixel( pLine->m_aValueEdit.GetSizePixel() );
+ }
else if ( nType == CUSTOM_TYPE_DATETIME)
{
// because m_aDateField and m_aTimeField have the same size for type "DateTime",
// we just rely on m_aTimeField here.
+ pLine->m_bIsDate = false;
pLine->m_aDateField.SetSizePixel( pLine->m_aTimeField.GetSizePixel() );
}
@@ -1711,6 +1716,10 @@ void CustomPropertiesWindow::updateLineWidth()
pCurrent++;
pNewCurrent++;
}
+
+ // if we have type "Date", we use the full width, not only the half
+ if (pNewLine->m_bIsDate)
+ pNewLine->m_aDateField.SetSizePixel( pNewLine->m_aValueEdit.GetSizePixel() );
}
}