summaryrefslogtreecommitdiff
path: root/svx/source/fmcomp
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-01-15 13:26:16 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-01-15 13:26:16 +0000
commit5f31541043ecb5fe8c30397716343afabc7c16a1 (patch)
treee9cfd1a2a155e1deac00beb19e34467b52fc7797 /svx/source/fmcomp
parent8725034e60238c47f3418d93f016cdce2a1e0ca4 (diff)
INTEGRATION: CWS dba22b (1.58.30); FILE MERGED
2006/12/18 10:41:50 fs 1.58.30.3: RESYNC: (1.58-1.60); FILE MERGED 2006/12/07 14:04:06 fs 1.58.30.2: #i68834# properly set the Edit/Literal mask, and ReformatAll after setting a text at a pattern field 2006/12/05 08:03:16 fs 1.58.30.1: #i72252# parseNodeTo*/getColumnRange: use XConnection instead of XDatabaseMetaData
Diffstat (limited to 'svx/source/fmcomp')
-rw-r--r--svx/source/fmcomp/gridcell.cxx40
1 files changed, 20 insertions, 20 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 5376ebe35338..5a5b2fbaa0fb 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: gridcell.cxx,v $
*
- * $Revision: 1.60 $
+ * $Revision: 1.61 $
*
- * last change: $Author: kz $ $Date: 2006-12-13 16:41:22 $
+ * last change: $Author: vg $ $Date: 2007-01-15 14:26:16 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -1747,7 +1747,6 @@ XubString DbCheckBox::GetFormatText(const Reference< XColumn >& /*_rxField*/, co
//==============================================================================
//= DbPatternField
-//==============================================================================
//------------------------------------------------------------------------------
DbPatternField::DbPatternField( DbGridColumn& _rColumn )
:DbCellControl( _rColumn )
@@ -1772,10 +1771,10 @@ void DbPatternField::implAdjustGenericFieldSetting( const Reference< XPropertySe
_rxModel->getPropertyValue( FM_PROP_EDITMASK ) >>= aEditMask;
_rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) >>= bStrict;
- ByteString aAsciiListMask( (const sal_Unicode*)aLitMask, RTL_TEXTENCODING_ASCII_US );
+ ByteString aAsciiEditMask( aEditMask.getStr(), RTL_TEXTENCODING_ASCII_US );
- static_cast< PatternField* >( m_pWindow )->SetMask( aAsciiListMask, aEditMask );
- static_cast< PatternField* >( m_pPainter )->SetMask( aAsciiListMask, aEditMask );
+ static_cast< PatternField* >( m_pWindow )->SetMask( aAsciiEditMask, aLitMask );
+ static_cast< PatternField* >( m_pPainter )->SetMask( aAsciiEditMask, aLitMask );
static_cast< PatternField* >( m_pWindow )->SetStrictFormat( bStrict );
static_cast< PatternField* >( m_pPainter )->SetStrictFormat( bStrict );
}
@@ -1798,27 +1797,28 @@ void DbPatternField::Init(Window* pParent, const Reference< XRowSet >& xCursor)
//------------------------------------------------------------------------------
CellControllerRef DbPatternField::CreateController() const
{
- return new SpinCellController((PatternField*)m_pWindow);
+ return new SpinCellController( static_cast< PatternField* >( m_pWindow ) );
+}
+
+//------------------------------------------------------------------------------
+String DbPatternField::impl_formatText( const String& _rText )
+{
+ m_pPainter->SetText( _rText );
+ static_cast< PatternField* >( m_pPainter )->ReformatAll();
+ return m_pPainter->GetText();
}
//------------------------------------------------------------------------------
String DbPatternField::GetFormatText(const Reference< ::com::sun::star::sdb::XColumn >& _rxField, const Reference< XNumberFormatter >& /*xFormatter*/, Color** /*ppColor*/)
{
- ::rtl::OUString aString;
- if (_rxField.is())
+ String aPureText;
+ if ( _rxField.is() )
{
- try
- {
- aString = _rxField->getString();
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
+ try { aPureText = _rxField->getString(); }
+ catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); }
}
- m_pPainter->SetText(aString);
- return m_pPainter->GetText();
+ return impl_formatText( aPureText );
}
//------------------------------------------------------------------------------
@@ -1837,7 +1837,7 @@ void DbPatternField::updateFromModel( Reference< XPropertySet > _rxModel )
::rtl::OUString sText;
_rxModel->getPropertyValue( FM_PROP_TEXT ) >>= sText;
- static_cast< Edit* >( m_pWindow )->SetText( sText );
+ static_cast< Edit* >( m_pWindow )->SetText( impl_formatText( sText ) );
static_cast< Edit* >( m_pWindow )->SetSelection( Selection( SELECTION_MAX, SELECTION_MIN ) );
}