summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-12-02 13:40:39 +0100
committerMathias Bauer <mba@openoffice.org>2009-12-02 13:40:39 +0100
commitd4fb305ef0e2b8d0332153f34800cd2b9520869b (patch)
tree1ce5d6e26aeb094e91482f2ea40edf300345ae41 /forms
parentd730f4672b31768f62d52ef7e673aec59d3a6a49 (diff)
parent749127e0507385584bdac9392174bebaba863546 (diff)
merge with db33a
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/DatabaseForm.cxx1
-rw-r--r--forms/source/component/ListBox.cxx10
-rw-r--r--forms/source/component/clickableimage.cxx5
-rw-r--r--forms/source/richtext/richtextcontrol.cxx29
-rw-r--r--forms/source/richtext/richtextcontrol.hxx3
-rw-r--r--forms/source/richtext/richtextimplcontrol.cxx25
-rw-r--r--forms/source/richtext/richtextvclcontrol.hxx4
7 files changed, 64 insertions, 13 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index cc5cf9ee7a27..081b971fcceb 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -152,7 +152,6 @@ public:
DocumentModifyGuard( const Reference< XInterface >& _rxFormComponent )
:m_xDocumentModify( getXModel( _rxFormComponent ), UNO_QUERY )
{
- OSL_ENSURE( m_xDocumentModify.is(), "DocumentModifyGuard::DocumentModifyGuard: no document, or no XModifiable2!" );
impl_changeModifiableFlag_nothrow( false );
}
~DocumentModifyGuard()
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index ec953f66c6f6..0a25f66fe401 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -1003,23 +1003,23 @@ namespace frm
sal_Bool OListBoxModel::commitControlValueToDbColumn( bool /*_bPostReset*/ )
{
// current selektion list
- const ORowSetValue rCurrentValue( getFirstSelectedValue() );
- if ( rCurrentValue != m_aSaveValue )
+ const ORowSetValue aCurrentValue( getFirstSelectedValue() );
+ if ( aCurrentValue != m_aSaveValue )
{
- if ( rCurrentValue.isNull() )
+ if ( aCurrentValue.isNull() )
m_xColumnUpdate->updateNull();
else
{
try
{
- m_xColumnUpdate->updateObject( rCurrentValue.makeAny() );
+ m_xColumnUpdate->updateObject( aCurrentValue.makeAny() );
}
catch ( const Exception& )
{
return sal_False;
}
}
- m_aSaveValue = rCurrentValue;
+ m_aSaveValue = aCurrentValue;
}
return sal_True;
}
diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx
index b9738ddd49ae..79d28727b5d5 100644
--- a/forms/source/component/clickableimage.cxx
+++ b/forms/source/component/clickableimage.cxx
@@ -435,6 +435,11 @@ namespace frm
// allowed to leave
throw;
}
+ catch( const WrappedTargetException& e )
+ {
+ // allowed to leave
+ throw;
+ }
catch( const Exception& e )
{
OSL_ENSURE( sal_False, "OClickableImageBaseControl::implSubmit: caught an unknown exception!" );
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx
index 76973f5e0348..9150eac63e17 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -46,6 +46,8 @@
/** === begin UNO includes === **/
#include <com/sun/star/awt/PosSize.hpp>
/** === end UNO includes === **/
+
+#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/svapp.hxx>
@@ -400,6 +402,33 @@ namespace frm
}
//--------------------------------------------------------------------
+ void SAL_CALL ORichTextPeer::draw( sal_Int32 _nX, sal_Int32 _nY ) throw(::com::sun::star::uno::RuntimeException)
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ RichTextControl* pControl = static_cast< RichTextControl* >( GetWindow() );
+ if ( !pControl )
+ return;
+
+ OutputDevice* pTargetDevice = VCLUnoHelper::GetOutputDevice( getGraphics() );
+ OSL_ENSURE( pTargetDevice != NULL, "ORichTextPeer::draw: no graphics -> no drawing!" );
+ if ( !pTargetDevice )
+ return;
+
+ ::Size aSize = pControl->GetSizePixel();
+ const MapUnit eTargetUnit = pTargetDevice->GetMapMode().GetMapUnit();
+ if ( eTargetUnit != MAP_PIXEL )
+ aSize = pControl->PixelToLogic( aSize, eTargetUnit );
+
+ ::Point aPos( _nX, _nY );
+ // the XView::draw API talks about pixels, always ...
+ if ( eTargetUnit != MAP_PIXEL )
+ aPos = pTargetDevice->PixelToLogic( aPos );
+
+ pControl->Draw( pTargetDevice, aPos, aSize, WINDOW_DRAW_NOCONTROLS );
+ }
+
+ //--------------------------------------------------------------------
void SAL_CALL ORichTextPeer::setProperty( const ::rtl::OUString& _rPropertyName, const Any& _rValue ) throw (RuntimeException)
{
if ( !GetWindow() )
diff --git a/forms/source/richtext/richtextcontrol.hxx b/forms/source/richtext/richtextcontrol.hxx
index 5775e2626d2d..eecff6527eea 100644
--- a/forms/source/richtext/richtextcontrol.hxx
+++ b/forms/source/richtext/richtextcontrol.hxx
@@ -135,6 +135,9 @@ namespace frm
ORichTextPeer();
~ORichTextPeer();
+ // XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
// XVclWindowPeer
virtual void SAL_CALL setProperty( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rValue ) throw (::com::sun::star::uno::RuntimeException);
diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx
index f85bab638499..259197ac71d1 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -605,21 +605,32 @@ namespace frm
_pDev->SetMapMode( aNormalizedMapMode );
// translate coordinates
- Point aPos( OutputDevice::LogicToLogic( _rPos, aOriginalMapMode, aNormalizedMapMode ) );
- Size aSize( OutputDevice::LogicToLogic( _rSize, aOriginalMapMode, aNormalizedMapMode ) );
+ Point aPos( _rPos );
+ Size aSize( _rSize );
+ if ( aOriginalMapMode.GetMapUnit() == MAP_PIXEL )
+ {
+ aPos = _pDev->PixelToLogic( _rPos, aNormalizedMapMode );
+ aSize = _pDev->PixelToLogic( _rSize, aNormalizedMapMode );
+ }
+ else
+ {
+ aPos = OutputDevice::LogicToLogic( _rPos, aOriginalMapMode, aNormalizedMapMode );
+ aSize = OutputDevice::LogicToLogic( _rSize, aOriginalMapMode, aNormalizedMapMode );
+ }
Rectangle aPlayground( aPos, aSize );
Size aOnePixel( _pDev->PixelToLogic( Size( 1, 1 ) ) );
+ aPlayground.Right() -= aOnePixel.Width();
+ aPlayground.Bottom() -= aOnePixel.Height();
// background
_pDev->SetLineColor();
- _pDev->DrawRect( Rectangle( aPlayground.TopLeft(), m_pEngine->GetPaperSize()) );
+ _pDev->DrawRect( aPlayground );
- // possibly with border
+ // do we need to draw a border?
bool bBorder = ( m_pAntiImpl->GetStyle() & WB_BORDER );
if ( bBorder )
- // let's draw a border
- _pDev->SetLineColor( COL_BLACK );
+ _pDev->SetLineColor( m_pAntiImpl->GetSettings().GetStyleSettings().GetMonoColor() );
else
_pDev->SetLineColor();
_pDev->SetFillColor( m_pAntiImpl->GetBackground().GetColor() );
@@ -632,7 +643,9 @@ namespace frm
// leave a space of one pixel between the "surroundings" of the control
// and the content
lcl_inflate( aPlayground, -aOnePixel.Width(), -aOnePixel.Height() );
+ lcl_inflate( aPlayground, -aOnePixel.Width(), -aOnePixel.Height() );
+ // actually draw the content
m_pEngine->Draw( _pDev, aPlayground, Point(), TRUE );
_pDev->Pop();
diff --git a/forms/source/richtext/richtextvclcontrol.hxx b/forms/source/richtext/richtextvclcontrol.hxx
index 778d31c3e6e1..a4f49aa2d41c 100644
--- a/forms/source/richtext/richtextvclcontrol.hxx
+++ b/forms/source/richtext/richtextvclcontrol.hxx
@@ -117,13 +117,15 @@ namespace frm
const EditView& getView() const;
EditView& getView();
+ // Window overridables
+ virtual void Draw( OutputDevice* _pDev, const Point& _rPos, const Size& _rSize, ULONG _nFlags );
+
protected:
// Window overridables
virtual void Resize();
virtual void GetFocus();
virtual void StateChanged( StateChangedType nStateChange );
virtual long PreNotify( NotifyEvent& _rNEvt );
- virtual void Draw( OutputDevice* _pDev, const Point& _rPos, const Size& _rSize, ULONG _nFlags );
virtual long Notify( NotifyEvent& _rNEvt );
private: