[Libreoffice-commits] core.git: svx/source
Noel Grandin
noel.grandin at collabora.co.uk
Wed Nov 22 11:16:04 UTC 2017
svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx | 58 -
svx/source/dialog/ClassificationDialog.cxx | 76 -
svx/source/dialog/connctrl.cxx | 106 +-
svx/source/dialog/framelink.cxx | 124 +-
svx/source/dialog/imapwnd.cxx | 124 +-
svx/source/dialog/langbox.cxx | 186 +--
svx/source/engine3d/obj3d.cxx | 154 +--
svx/source/engine3d/view3d.cxx | 418 ++++----
svx/source/fmcomp/gridcell.cxx | 533 +++++-----
svx/source/fmcomp/gridctrl.cxx | 100 -
svx/source/form/fmobjfac.cxx | 48
svx/source/form/fmshimp.cxx | 126 +-
svx/source/form/tbxform.cxx | 38
svx/source/gallery2/galbrws1.cxx | 34
svx/source/gallery2/galctrl.cxx | 86 -
svx/source/gallery2/galtheme.cxx | 264 ++---
svx/source/mnuctrls/smarttagmenu.cxx | 62 -
svx/source/sdr/overlay/overlaytools.cxx | 161 +--
svx/source/sdr/properties/attributeproperties.cxx | 66 -
svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 80 -
svx/source/svdraw/svddrgmt.cxx | 418 ++++----
svx/source/svdraw/svdedtv1.cxx | 332 +++---
svx/source/svdraw/svdedtv2.cxx | 567 +++++------
svx/source/svdraw/svdfmtf.cxx | 336 +++---
svx/source/svdraw/svdhdl.cxx | 162 +--
svx/source/svdraw/svdmrkv.cxx | 526 +++++-----
svx/source/svdraw/svdogrp.cxx | 83 -
svx/source/svdraw/svdopath.cxx | 34
svx/source/svdraw/svdotext.cxx | 124 +-
svx/source/svdraw/svdotextdecomposition.cxx | 616 ++++++------
svx/source/svdraw/svdotxed.cxx | 35
svx/source/svdraw/svdpage.cxx | 35
svx/source/svdraw/svdpagv.cxx | 352 +++---
svx/source/svdraw/svdpntv.cxx | 76 -
svx/source/svdraw/svdtext.cxx | 72 -
svx/source/table/tablecontroller.cxx | 145 +-
svx/source/tbxctrls/colrctrl.cxx | 36
svx/source/tbxctrls/itemwin.cxx | 94 -
svx/source/tbxctrls/layctrl.cxx | 58 -
svx/source/tbxctrls/linectrl.cxx | 72 -
svx/source/tbxctrls/tbcontrl.cxx | 130 +-
svx/source/tbxctrls/tbunosearchcontrollers.cxx | 80 -
svx/source/tbxctrls/tbxcolorupdate.cxx | 178 +--
svx/source/unodraw/unoshape.cxx | 58 -
svx/source/xoutdev/_xpoly.cxx | 96 -
45 files changed, 3783 insertions(+), 3776 deletions(-)
New commits:
commit 3fbbd74b7bc6aef4af5f0c4b23a73a6726b9afbf
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Nov 21 15:49:27 2017 +0200
loplugin:flatten in svx
Change-Id: Idc4d0186ecc6f0722c2b1358486a2430f037ae29
Reviewed-on: https://gerrit.libreoffice.org/45036
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx b/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx
index 01fb333104c0..1e0ca231c092 100644
--- a/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx
+++ b/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx
@@ -40,40 +40,40 @@ void VCLXAccessibleSvxFindReplaceDialog::FillAccessibleRelationSet( utl::Accessi
{
VCLXAccessibleComponent::FillAccessibleRelationSet( rRelationSet );
VclPtr<vcl::Window> pDlg = GetWindow();
- if ( pDlg )
+ if ( !pDlg )
+ return;
+
+ SvxSearchDialog* pSrchDlg = static_cast<SvxSearchDialog*>( pDlg.get() );
+ vcl::Window* pDocWin = pSrchDlg->GetDocWin();
+ if ( !pDocWin )
{
- SvxSearchDialog* pSrchDlg = static_cast<SvxSearchDialog*>( pDlg.get() );
- vcl::Window* pDocWin = pSrchDlg->GetDocWin();
- if ( !pDocWin )
- {
- return;
- }
- Reference < css::accessibility::XAccessible > xDocAcc = pDocWin->GetAccessible();
- if ( !xDocAcc.is() )
- {
- return;
- }
- Reference< css::accessibility::XAccessibleGetAccFlowTo > xGetAccFlowTo( xDocAcc, UNO_QUERY );
- if ( !xGetAccFlowTo.is() )
- {
- return;
- }
+ return;
+ }
+ Reference < css::accessibility::XAccessible > xDocAcc = pDocWin->GetAccessible();
+ if ( !xDocAcc.is() )
+ {
+ return;
+ }
+ Reference< css::accessibility::XAccessibleGetAccFlowTo > xGetAccFlowTo( xDocAcc, UNO_QUERY );
+ if ( !xGetAccFlowTo.is() )
+ {
+ return;
+ }
- const sal_Int32 FORFINDREPLACEFLOWTO = 2;
- uno::Sequence<uno::Any> aAnySeq = xGetAccFlowTo->getAccFlowTo( Any(pSrchDlg->GetSrchFlag()), FORFINDREPLACEFLOWTO );
+ const sal_Int32 FORFINDREPLACEFLOWTO = 2;
+ uno::Sequence<uno::Any> aAnySeq = xGetAccFlowTo->getAccFlowTo( Any(pSrchDlg->GetSrchFlag()), FORFINDREPLACEFLOWTO );
- sal_Int32 nLen = aAnySeq.getLength();
- if ( nLen )
+ sal_Int32 nLen = aAnySeq.getLength();
+ if ( nLen )
+ {
+ uno::Sequence< uno::Reference< uno::XInterface > > aSequence( nLen );
+ for ( sal_Int32 i = 0; i < nLen; i++ )
{
- uno::Sequence< uno::Reference< uno::XInterface > > aSequence( nLen );
- for ( sal_Int32 i = 0; i < nLen; i++ )
- {
- uno::Reference < css::accessibility::XAccessible > xAcc;
- aAnySeq[i] >>= xAcc;
- aSequence[i] = xAcc;
- }
- rRelationSet.AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::CONTENT_FLOWS_TO, aSequence ) );
+ uno::Reference < css::accessibility::XAccessible > xAcc;
+ aAnySeq[i] >>= xAcc;
+ aSequence[i] = xAcc;
}
+ rRelationSet.AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::CONTENT_FLOWS_TO, aSequence ) );
}
}
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index ad6d6ded5074..55dc11c86a50 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -575,55 +575,55 @@ std::vector<ClassificationResult> ClassificationDialog::getResult()
IMPL_LINK(ClassificationDialog, SelectClassificationHdl, ListBox&, rBox, void)
{
const sal_Int32 nSelected = rBox.GetSelectedEntryPos();
- if (nSelected >= 0 && m_nCurrentSelectedCategory != nSelected)
- {
- std::unique_ptr<EditTextObject> pEditText(m_pEditWindow->pEdEngine->CreateTextObject());
- std::vector<editeng::Section> aSections;
- pEditText->GetAllSections(aSections);
+ if (nSelected < 0 || m_nCurrentSelectedCategory == nSelected)
+ return;
+
+ std::unique_ptr<EditTextObject> pEditText(m_pEditWindow->pEdEngine->CreateTextObject());
+ std::vector<editeng::Section> aSections;
+ pEditText->GetAllSections(aSections);
- // if we are replacing an existing field
- bool bReplaceExisting = false;
- // selection of the existing field, which will be replaced
- ESelection aExistingFieldSelection;
+ // if we are replacing an existing field
+ bool bReplaceExisting = false;
+ // selection of the existing field, which will be replaced
+ ESelection aExistingFieldSelection;
- for (editeng::Section const & rSection : aSections)
+ for (editeng::Section const & rSection : aSections)
+ {
+ const SvxFieldItem* pFieldItem = findField(rSection);
+ if (pFieldItem)
{
- const SvxFieldItem* pFieldItem = findField(rSection);
- if (pFieldItem)
+ const ClassificationField* pClassificationField = dynamic_cast<const ClassificationField*>(pFieldItem->GetField());
+ if (pClassificationField && pClassificationField->meType == ClassificationType::CATEGORY)
{
- const ClassificationField* pClassificationField = dynamic_cast<const ClassificationField*>(pFieldItem->GetField());
- if (pClassificationField && pClassificationField->meType == ClassificationType::CATEGORY)
- {
- aExistingFieldSelection = ESelection(rSection.mnParagraph, rSection.mnStart,
- rSection.mnParagraph, rSection.mnEnd);
- bReplaceExisting = true;
- }
+ aExistingFieldSelection = ESelection(rSection.mnParagraph, rSection.mnStart,
+ rSection.mnParagraph, rSection.mnEnd);
+ bReplaceExisting = true;
}
}
+ }
- if (bReplaceExisting)
+ if (bReplaceExisting)
+ {
+ ScopedVclPtrInstance<QueryBox> aQueryBox(this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, SvxResId(RID_CLASSIFICATION_CHANGE_CATEGORY));
+ if (aQueryBox->Execute() == RET_NO)
{
- ScopedVclPtrInstance<QueryBox> aQueryBox(this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, SvxResId(RID_CLASSIFICATION_CHANGE_CATEGORY));
- if (aQueryBox->Execute() == RET_NO)
- {
- // Revert to previosuly selected
- m_pInternationalClassificationListBox->SelectEntryPos(m_nCurrentSelectedCategory);
- m_pClassificationListBox->SelectEntryPos(m_nCurrentSelectedCategory);
- return;
- }
- m_pEditWindow->pEdView->SetSelection(aExistingFieldSelection);
+ // Revert to previosuly selected
+ m_pInternationalClassificationListBox->SelectEntryPos(m_nCurrentSelectedCategory);
+ m_pClassificationListBox->SelectEntryPos(m_nCurrentSelectedCategory);
+ return;
}
+ m_pEditWindow->pEdView->SetSelection(aExistingFieldSelection);
+ }
- const OUString aFullString = maHelper.GetBACNames()[nSelected];
- const OUString aAbbreviatedString = maHelper.GetAbbreviatedBACNames()[nSelected];
- const OUString aIdentifierString = maHelper.GetBACIdentifiers()[nSelected];
- insertField(ClassificationType::CATEGORY, aAbbreviatedString, aFullString, aIdentifierString);
+ const OUString aFullString = maHelper.GetBACNames()[nSelected];
+ const OUString aAbbreviatedString = maHelper.GetAbbreviatedBACNames()[nSelected];
+ const OUString aIdentifierString = maHelper.GetBACIdentifiers()[nSelected];
+ insertField(ClassificationType::CATEGORY, aAbbreviatedString, aFullString, aIdentifierString);
- // Change category to the new selection
- m_pInternationalClassificationListBox->SelectEntryPos(nSelected);
- m_pClassificationListBox->SelectEntryPos(nSelected);
- m_nCurrentSelectedCategory = nSelected;
- }
+ // Change category to the new selection
+ m_pInternationalClassificationListBox->SelectEntryPos(nSelected);
+ m_pClassificationListBox->SelectEntryPos(nSelected);
+ m_nCurrentSelectedCategory = nSelected;
}
IMPL_LINK(ClassificationDialog, SelectMarkingHdl, ListBox&, rBox, void)
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index 1acaa9db15ad..3828980f7dc0 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -76,67 +76,67 @@ Size SvxXConnectionPreview::GetOptimalSize() const
void SvxXConnectionPreview::AdaptSize()
{
// Adapt size
- if( pObjList )
- {
- SetMapMode(MapMode(MapUnit::Map100thMM));
+ if( !pObjList )
+ return;
- OutputDevice* pOD = pView->GetFirstOutputDevice(); // GetWin( 0 );
- tools::Rectangle aRect = pObjList->GetAllObjBoundRect();
+ SetMapMode(MapMode(MapUnit::Map100thMM));
- MapMode aMapMode = GetMapMode();
- aMapMode.SetMapUnit( pOD->GetMapMode().GetMapUnit() );
- SetMapMode( aMapMode );
-
- MapMode aDisplayMap( aMapMode );
- Point aNewPos;
- Size aNewSize;
- const Size aWinSize = PixelToLogic( GetOutputSizePixel(), aDisplayMap );
- const long nWidth = aWinSize.Width();
- const long nHeight = aWinSize.Height();
- if (aRect.GetHeight() == 0)
- return;
- double fRectWH = (double) aRect.GetWidth() / aRect.GetHeight();
- if (nHeight == 0)
- return;
- double fWinWH = (double) nWidth / nHeight;
-
- // Adapt bitmap to Thumb size (not here!)
- if ( fRectWH < fWinWH)
- {
- aNewSize.Width() = (long) ( (double) nHeight * fRectWH );
- aNewSize.Height()= nHeight;
- }
- else
- {
- aNewSize.Width() = nWidth;
- aNewSize.Height()= (long) ( (double) nWidth / fRectWH );
- }
+ OutputDevice* pOD = pView->GetFirstOutputDevice(); // GetWin( 0 );
+ tools::Rectangle aRect = pObjList->GetAllObjBoundRect();
+
+ MapMode aMapMode = GetMapMode();
+ aMapMode.SetMapUnit( pOD->GetMapMode().GetMapUnit() );
+ SetMapMode( aMapMode );
+
+ MapMode aDisplayMap( aMapMode );
+ Point aNewPos;
+ Size aNewSize;
+ const Size aWinSize = PixelToLogic( GetOutputSizePixel(), aDisplayMap );
+ const long nWidth = aWinSize.Width();
+ const long nHeight = aWinSize.Height();
+ if (aRect.GetHeight() == 0)
+ return;
+ double fRectWH = (double) aRect.GetWidth() / aRect.GetHeight();
+ if (nHeight == 0)
+ return;
+ double fWinWH = (double) nWidth / nHeight;
+
+ // Adapt bitmap to Thumb size (not here!)
+ if ( fRectWH < fWinWH)
+ {
+ aNewSize.Width() = (long) ( (double) nHeight * fRectWH );
+ aNewSize.Height()= nHeight;
+ }
+ else
+ {
+ aNewSize.Width() = nWidth;
+ aNewSize.Height()= (long) ( (double) nWidth / fRectWH );
+ }
- Fraction aFrac1( aWinSize.Width(), aRect.GetWidth() );
- Fraction aFrac2( aWinSize.Height(), aRect.GetHeight() );
- Fraction aMinFrac( aFrac1 <= aFrac2 ? aFrac1 : aFrac2 );
+ Fraction aFrac1( aWinSize.Width(), aRect.GetWidth() );
+ Fraction aFrac2( aWinSize.Height(), aRect.GetHeight() );
+ Fraction aMinFrac( aFrac1 <= aFrac2 ? aFrac1 : aFrac2 );
- // Implement MapMode
- aDisplayMap.SetScaleX( aMinFrac );
- aDisplayMap.SetScaleY( aMinFrac );
+ // Implement MapMode
+ aDisplayMap.SetScaleX( aMinFrac );
+ aDisplayMap.SetScaleY( aMinFrac );
- // Centering
- aNewPos.X() = ( nWidth - aNewSize.Width() ) >> 1;
- aNewPos.Y() = ( nHeight - aNewSize.Height() ) >> 1;
+ // Centering
+ aNewPos.X() = ( nWidth - aNewSize.Width() ) >> 1;
+ aNewPos.Y() = ( nHeight - aNewSize.Height() ) >> 1;
- aDisplayMap.SetOrigin( LogicToLogic( aNewPos, aMapMode, aDisplayMap ) );
- SetMapMode( aDisplayMap );
+ aDisplayMap.SetOrigin( LogicToLogic( aNewPos, aMapMode, aDisplayMap ) );
+ SetMapMode( aDisplayMap );
- // Origin
- aNewPos = aDisplayMap.GetOrigin();
- aNewPos -= Point( aRect.TopLeft().X(), aRect.TopLeft().Y() );
- aDisplayMap.SetOrigin( aNewPos );
- SetMapMode( aDisplayMap );
+ // Origin
+ aNewPos = aDisplayMap.GetOrigin();
+ aNewPos -= Point( aRect.TopLeft().X(), aRect.TopLeft().Y() );
+ aDisplayMap.SetOrigin( aNewPos );
+ SetMapMode( aDisplayMap );
- Point aPos;
- MouseEvent aMEvt( aPos, 1, MouseEventModifiers::NONE, MOUSE_RIGHT );
- MouseButtonDown( aMEvt );
- }
+ Point aPos;
+ MouseEvent aMEvt( aPos, 1, MouseEventModifiers::NONE, MOUSE_RIGHT );
+ MouseButtonDown( aMEvt );
}
void SvxXConnectionPreview::Construct()
diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx
index f96c3b5e5f95..e86e6f1b3e34 100644
--- a/svx/source/dialog/framelink.cxx
+++ b/svx/source/dialog/framelink.cxx
@@ -711,77 +711,77 @@ void CreateBorderPrimitives(
// get offset color pairs for style, one per visible line
const StyleVectorCombination aCombination(rBorder, rX, 0.0, false, pForceColor);
- if(!aCombination.empty())
+ if(aCombination.empty())
+ return;
+
+ const basegfx::B2DVector aPerpendX(basegfx::getNormalizedPerpendicular(rX));
+ const bool bHasStartStyles(!rStartStyleVectorTable.empty());
+ const bool bHasEndStyles(!rEndStyleVectorTable.empty());
+ const size_t nOffsets(aCombination.size());
+ std::vector<ExtendSet> aExtendSetStart(nOffsets);
+ std::vector<ExtendSet> aExtendSetEnd(nOffsets);
+
+ if(bHasStartStyles)
{
- const basegfx::B2DVector aPerpendX(basegfx::getNormalizedPerpendicular(rX));
- const bool bHasStartStyles(!rStartStyleVectorTable.empty());
- const bool bHasEndStyles(!rEndStyleVectorTable.empty());
- const size_t nOffsets(aCombination.size());
- std::vector<ExtendSet> aExtendSetStart(nOffsets);
- std::vector<ExtendSet> aExtendSetEnd(nOffsets);
-
- if(bHasStartStyles)
- {
- // create extends for line starts, use given point/vector and offsets
- getExtends(aExtendSetStart, rOrigin, aCombination, aPerpendX, rStartStyleVectorTable.getEntries());
- }
+ // create extends for line starts, use given point/vector and offsets
+ getExtends(aExtendSetStart, rOrigin, aCombination, aPerpendX, rStartStyleVectorTable.getEntries());
+ }
- if(bHasEndStyles)
- {
- // Create extends for line ends, create inverse point/vector and inverse offsets.
- const StyleVectorCombination aMirroredCombination(rBorder, -rX, 0.0, true, pForceColor);
+ if(bHasEndStyles)
+ {
+ // Create extends for line ends, create inverse point/vector and inverse offsets.
+ const StyleVectorCombination aMirroredCombination(rBorder, -rX, 0.0, true, pForceColor);
- getExtends(aExtendSetEnd, rOrigin + rX, aMirroredCombination, -aPerpendX, rEndStyleVectorTable.getEntries());
+ getExtends(aExtendSetEnd, rOrigin + rX, aMirroredCombination, -aPerpendX, rEndStyleVectorTable.getEntries());
- // also need to inverse the result to apply to the correct lines
- std::reverse(aExtendSetEnd.begin(), aExtendSetEnd.end());
- }
+ // also need to inverse the result to apply to the correct lines
+ std::reverse(aExtendSetEnd.begin(), aExtendSetEnd.end());
+ }
- std::vector< drawinglayer::primitive2d::BorderLine > aBorderlines;
- const double fNegLength(-rX.getLength());
+ std::vector< drawinglayer::primitive2d::BorderLine > aBorderlines;
+ const double fNegLength(-rX.getLength());
- for(size_t a(0); a < nOffsets; a++)
+ for(size_t a(0); a < nOffsets; a++)
+ {
+ Color aMyColor;
+ double fMyOffset(0.0);
+ double fMyHalfWidth(0.0);
+ aCombination.getColorAndOffsetAndHalfWidth(a, aMyColor, fMyOffset, fMyHalfWidth);
+ const ExtendSet& rExtStart(aExtendSetStart[a]);
+ const ExtendSet& rExtEnd(aExtendSetEnd[a]);
+
+ if(0xff == aMyColor.GetTransparency())
{
- Color aMyColor;
- double fMyOffset(0.0);
- double fMyHalfWidth(0.0);
- aCombination.getColorAndOffsetAndHalfWidth(a, aMyColor, fMyOffset, fMyHalfWidth);
- const ExtendSet& rExtStart(aExtendSetStart[a]);
- const ExtendSet& rExtEnd(aExtendSetEnd[a]);
-
- if(0xff == aMyColor.GetTransparency())
- {
- aBorderlines.push_back(
- drawinglayer::primitive2d::BorderLine(
- fMyHalfWidth * 2.0));
- }
- else
- {
- aBorderlines.push_back(
- drawinglayer::primitive2d::BorderLine(
- drawinglayer::attribute::LineAttribute(
- aMyColor.getBColor(),
- fMyHalfWidth * 2.0),
- fNegLength * rExtStart.mfExtLeft,
- fNegLength * rExtStart.mfExtRight,
- fNegLength * rExtEnd.mfExtRight,
- fNegLength * rExtEnd.mfExtLeft));
- }
+ aBorderlines.push_back(
+ drawinglayer::primitive2d::BorderLine(
+ fMyHalfWidth * 2.0));
+ }
+ else
+ {
+ aBorderlines.push_back(
+ drawinglayer::primitive2d::BorderLine(
+ drawinglayer::attribute::LineAttribute(
+ aMyColor.getBColor(),
+ fMyHalfWidth * 2.0),
+ fNegLength * rExtStart.mfExtLeft,
+ fNegLength * rExtStart.mfExtRight,
+ fNegLength * rExtEnd.mfExtRight,
+ fNegLength * rExtEnd.mfExtLeft));
}
-
- static double fPatScFact(10.0); // 10.0 multiply, see old code
- const std::vector<double> aDashing(svtools::GetLineDashing(rBorder.Type(), rBorder.PatternScale() * fPatScFact));
- const drawinglayer::attribute::StrokeAttribute aStrokeAttribute(aDashing);
- const basegfx::B2DPoint aStart(rOrigin + (aPerpendX * aCombination.getRefModeOffset()));
-
- rTarget.append(
- drawinglayer::primitive2d::Primitive2DReference(
- new drawinglayer::primitive2d::BorderLinePrimitive2D(
- aStart,
- aStart + rX,
- aBorderlines,
- aStrokeAttribute)));
}
+
+ static double fPatScFact(10.0); // 10.0 multiply, see old code
+ const std::vector<double> aDashing(svtools::GetLineDashing(rBorder.Type(), rBorder.PatternScale() * fPatScFact));
+ const drawinglayer::attribute::StrokeAttribute aStrokeAttribute(aDashing);
+ const basegfx::B2DPoint aStart(rOrigin + (aPerpendX * aCombination.getRefModeOffset()));
+
+ rTarget.append(
+ drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::BorderLinePrimitive2D(
+ aStart,
+ aStart + rX,
+ aBorderlines,
+ aStrokeAttribute)));
}
}
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 732abec9865a..693df0354491 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -632,30 +632,30 @@ void IMapWindow::DoMacroAssign()
{
SdrObject* pSdrObj = GetSelectedSdrObject();
- if ( pSdrObj )
- {
- SfxItemSet aSet( *pIMapPool, svl::Items<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>{} );
+ if ( !pSdrObj )
+ return;
- SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
- aNamesItem.AddEvent( "MouseOver", "", SvMacroItemId::OnMouseOver );
- aNamesItem.AddEvent( "MouseOut", "", SvMacroItemId::OnMouseOut );
- aSet.Put( aNamesItem );
+ SfxItemSet aSet( *pIMapPool, svl::Items<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>{} );
- SvxMacroItem aMacroItem(SID_ATTR_MACROITEM);
- IMapObject* pIMapObj = GetIMapObj( pSdrObj );
- aMacroItem.SetMacroTable( pIMapObj->GetMacroTable() );
- aSet.Put( aMacroItem );
+ SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
+ aNamesItem.AddEvent( "MouseOver", "", SvMacroItemId::OnMouseOver );
+ aNamesItem.AddEvent( "MouseOut", "", SvMacroItemId::OnMouseOut );
+ aSet.Put( aNamesItem );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateSfxDialog( this, aSet, mxDocumentFrame, SID_EVENTCONFIG ));
+ SvxMacroItem aMacroItem(SID_ATTR_MACROITEM);
+ IMapObject* pIMapObj = GetIMapObj( pSdrObj );
+ aMacroItem.SetMacroTable( pIMapObj->GetMacroTable() );
+ aSet.Put( aMacroItem );
- if ( pMacroDlg && pMacroDlg->Execute() == RET_OK )
- {
- const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
- pIMapObj->SetMacroTable( static_cast<const SvxMacroItem& >(pOutSet->Get( SID_ATTR_MACROITEM )).GetMacroTable() );
- pModel->SetChanged();
- UpdateInfo( false );
- }
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateSfxDialog( this, aSet, mxDocumentFrame, SID_EVENTCONFIG ));
+
+ if ( pMacroDlg && pMacroDlg->Execute() == RET_OK )
+ {
+ const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
+ pIMapObj->SetMacroTable( static_cast<const SvxMacroItem& >(pOutSet->Get( SID_ATTR_MACROITEM )).GetMacroTable() );
+ pModel->SetChanged();
+ UpdateInfo( false );
}
}
@@ -735,53 +735,53 @@ void IMapWindow::CreateDefaultObject()
{
SdrPageView* pPageView = pView->GetSdrPageView();
- if(pPageView)
+ if(!pPageView)
+ return;
+
+ // calc position and size
+ Point aPagePos(0, 0); // = pPageView->GetOffset();
+ Size aPageSize = pPageView->GetPage()->GetSize();
+ sal_uInt32 nDefaultObjectSizeWidth = aPageSize.Width() / 4;
+ sal_uInt32 nDefaultObjectSizeHeight = aPageSize.Height() / 4;
+ aPagePos.X() += (aPageSize.Width() / 2) - (nDefaultObjectSizeWidth / 2);
+ aPagePos.Y() += (aPageSize.Height() / 2) - (nDefaultObjectSizeHeight / 2);
+ tools::Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
+
+ SdrObject* pObj = SdrObjFactory::MakeNewObject( pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(), nullptr, pModel);
+ pObj->SetLogicRect(aNewObjectRectangle);
+
+ switch( pObj->GetObjIdentifier() )
{
- // calc position and size
- Point aPagePos(0, 0); // = pPageView->GetOffset();
- Size aPageSize = pPageView->GetPage()->GetSize();
- sal_uInt32 nDefaultObjectSizeWidth = aPageSize.Width() / 4;
- sal_uInt32 nDefaultObjectSizeHeight = aPageSize.Height() / 4;
- aPagePos.X() += (aPageSize.Width() / 2) - (nDefaultObjectSizeWidth / 2);
- aPagePos.Y() += (aPageSize.Height() / 2) - (nDefaultObjectSizeHeight / 2);
- tools::Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
-
- SdrObject* pObj = SdrObjFactory::MakeNewObject( pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(), nullptr, pModel);
- pObj->SetLogicRect(aNewObjectRectangle);
-
- switch( pObj->GetObjIdentifier() )
+ case OBJ_POLY:
+ case OBJ_PATHPOLY:
{
- case OBJ_POLY:
- case OBJ_PATHPOLY:
- {
- basegfx::B2DPolygon aInnerPoly;
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.BottomLeft().X(), aNewObjectRectangle.BottomLeft().Y()));
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.TopLeft().X(), aNewObjectRectangle.TopLeft().Y()));
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.TopCenter().X(), aNewObjectRectangle.TopCenter().Y()));
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.Center().X(), aNewObjectRectangle.Center().Y()));
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.RightCenter().X(), aNewObjectRectangle.RightCenter().Y()));
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.BottomRight().X(), aNewObjectRectangle.BottomRight().Y()));
- aInnerPoly.setClosed(true);
- static_cast<SdrPathObj*>(pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aInnerPoly));
- break;
- }
- case OBJ_FREEFILL:
- case OBJ_PATHFILL:
- {
- sal_Int32 nWdt(aNewObjectRectangle.GetWidth() / 2);
- sal_Int32 nHgt(aNewObjectRectangle.GetHeight() / 2);
- basegfx::B2DPolygon aInnerPoly(XPolygon(aNewObjectRectangle.Center(), nWdt, nHgt).getB2DPolygon());
- static_cast<SdrPathObj*>(pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aInnerPoly));
- break;
- }
-
+ basegfx::B2DPolygon aInnerPoly;
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.BottomLeft().X(), aNewObjectRectangle.BottomLeft().Y()));
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.TopLeft().X(), aNewObjectRectangle.TopLeft().Y()));
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.TopCenter().X(), aNewObjectRectangle.TopCenter().Y()));
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.Center().X(), aNewObjectRectangle.Center().Y()));
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.RightCenter().X(), aNewObjectRectangle.RightCenter().Y()));
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.BottomRight().X(), aNewObjectRectangle.BottomRight().Y()));
+ aInnerPoly.setClosed(true);
+ static_cast<SdrPathObj*>(pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aInnerPoly));
+ break;
+ }
+ case OBJ_FREEFILL:
+ case OBJ_PATHFILL:
+ {
+ sal_Int32 nWdt(aNewObjectRectangle.GetWidth() / 2);
+ sal_Int32 nHgt(aNewObjectRectangle.GetHeight() / 2);
+ basegfx::B2DPolygon aInnerPoly(XPolygon(aNewObjectRectangle.Center(), nWdt, nHgt).getB2DPolygon());
+ static_cast<SdrPathObj*>(pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aInnerPoly));
+ break;
}
- pView->InsertObjectAtView(pObj, *pPageView);
- SdrObjCreated( *pObj );
- SetCurrentObjState( true );
- pView->MarkObj( pObj, pPageView );
}
+
+ pView->InsertObjectAtView(pObj, *pPageView);
+ SdrObjCreated( *pObj );
+ SetCurrentObjState( true );
+ pView->MarkObj( pObj, pPageView );
}
void IMapWindow::SelectFirstObject()
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 9ba9c5052b25..a50adec606d8 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -231,112 +231,112 @@ void SvxLanguageBoxBase::SetLanguageList( SvxLanguageListFlags nLangList,
m_bLangNoneIsLangAll = bLangNoneIsLangAll;
m_bWithCheckmark = bCheckSpellAvail;
- if ( SvxLanguageListFlags::EMPTY != nLangList )
+ if ( SvxLanguageListFlags::EMPTY == nLangList )
+ return;
+
+ bool bAddAvailable = (!(nLangList & SvxLanguageListFlags::ONLY_KNOWN) &&
+ ((nLangList & SvxLanguageListFlags::ALL) ||
+ (nLangList & SvxLanguageListFlags::WESTERN) ||
+ (nLangList & SvxLanguageListFlags::CTL) ||
+ (nLangList & SvxLanguageListFlags::CJK)));
+ std::vector< LanguageType > aSpellAvailLang;
+ std::vector< LanguageType > aHyphAvailLang;
+ std::vector< LanguageType > aThesAvailLang;
+ Sequence< sal_Int16 > aSpellUsedLang;
+ std::vector< LanguageType > aHyphUsedLang;
+ std::vector< LanguageType > aThesUsedLang;
+ Reference< XAvailableLocales > xAvail( LinguMgr::GetLngSvcMgr(), UNO_QUERY );
+ if (xAvail.is())
{
- bool bAddAvailable = (!(nLangList & SvxLanguageListFlags::ONLY_KNOWN) &&
- ((nLangList & SvxLanguageListFlags::ALL) ||
- (nLangList & SvxLanguageListFlags::WESTERN) ||
- (nLangList & SvxLanguageListFlags::CTL) ||
- (nLangList & SvxLanguageListFlags::CJK)));
- std::vector< LanguageType > aSpellAvailLang;
- std::vector< LanguageType > aHyphAvailLang;
- std::vector< LanguageType > aThesAvailLang;
- Sequence< sal_Int16 > aSpellUsedLang;
- std::vector< LanguageType > aHyphUsedLang;
- std::vector< LanguageType > aThesUsedLang;
- Reference< XAvailableLocales > xAvail( LinguMgr::GetLngSvcMgr(), UNO_QUERY );
- if (xAvail.is())
- {
- Sequence< css::lang::Locale > aTmp;
+ Sequence< css::lang::Locale > aTmp;
- if (bAddAvailable || (SvxLanguageListFlags::SPELL_AVAIL & nLangList))
- {
- aTmp = xAvail->getAvailableLocales( SN_SPELLCHECKER );
- aSpellAvailLang = lcl_LocaleSeqToLangSeq( aTmp );
- }
- if (bAddAvailable || (SvxLanguageListFlags::HYPH_AVAIL & nLangList))
- {
- aTmp = xAvail->getAvailableLocales( SN_HYPHENATOR );
- aHyphAvailLang = lcl_LocaleSeqToLangSeq( aTmp );
- }
- if (bAddAvailable || (SvxLanguageListFlags::THES_AVAIL & nLangList))
- {
- aTmp = xAvail->getAvailableLocales( SN_THESAURUS );
- aThesAvailLang = lcl_LocaleSeqToLangSeq( aTmp );
- }
- }
- if (SvxLanguageListFlags::SPELL_USED & nLangList)
- {
- Reference< XSpellChecker1 > xTmp1( LinguMgr::GetSpellChecker(), UNO_QUERY );
- if (xTmp1.is())
- aSpellUsedLang = xTmp1->getLanguages();
- }
- if (SvxLanguageListFlags::HYPH_USED & nLangList)
+ if (bAddAvailable || (SvxLanguageListFlags::SPELL_AVAIL & nLangList))
{
- Reference< XHyphenator > xTmp( LinguMgr::GetHyphenator() );
- if (xTmp.is()) {
- Sequence < css::lang::Locale > aLocaleSequence( xTmp->getLocales() );
- aHyphUsedLang = lcl_LocaleSeqToLangSeq( aLocaleSequence );
- }
+ aTmp = xAvail->getAvailableLocales( SN_SPELLCHECKER );
+ aSpellAvailLang = lcl_LocaleSeqToLangSeq( aTmp );
}
- if (SvxLanguageListFlags::THES_USED & nLangList)
+ if (bAddAvailable || (SvxLanguageListFlags::HYPH_AVAIL & nLangList))
{
- Reference< XThesaurus > xTmp( LinguMgr::GetThesaurus() );
- if (xTmp.is()) {
- Sequence < css::lang::Locale > aLocaleSequence( xTmp->getLocales() );
- aThesUsedLang = lcl_LocaleSeqToLangSeq( aLocaleSequence );
- }
+ aTmp = xAvail->getAvailableLocales( SN_HYPHENATOR );
+ aHyphAvailLang = lcl_LocaleSeqToLangSeq( aTmp );
}
-
- std::vector<LanguageType> aKnown;
- sal_uInt32 nCount;
- if ( nLangList & SvxLanguageListFlags::ONLY_KNOWN )
+ if (bAddAvailable || (SvxLanguageListFlags::THES_AVAIL & nLangList))
{
- aKnown = LocaleDataWrapper::getInstalledLanguageTypes();
- nCount = aKnown.size();
+ aTmp = xAvail->getAvailableLocales( SN_THESAURUS );
+ aThesAvailLang = lcl_LocaleSeqToLangSeq( aTmp );
}
- else
- {
- nCount = SvtLanguageTable::GetLanguageEntryCount();
+ }
+ if (SvxLanguageListFlags::SPELL_USED & nLangList)
+ {
+ Reference< XSpellChecker1 > xTmp1( LinguMgr::GetSpellChecker(), UNO_QUERY );
+ if (xTmp1.is())
+ aSpellUsedLang = xTmp1->getLanguages();
+ }
+ if (SvxLanguageListFlags::HYPH_USED & nLangList)
+ {
+ Reference< XHyphenator > xTmp( LinguMgr::GetHyphenator() );
+ if (xTmp.is()) {
+ Sequence < css::lang::Locale > aLocaleSequence( xTmp->getLocales() );
+ aHyphUsedLang = lcl_LocaleSeqToLangSeq( aLocaleSequence );
}
- for ( sal_uInt32 i = 0; i < nCount; i++ )
- {
- LanguageType nLangType;
- if ( nLangList & SvxLanguageListFlags::ONLY_KNOWN )
- nLangType = aKnown[i];
- else
- nLangType = SvtLanguageTable::GetLanguageTypeAtIndex( i );
- if ( lcl_isPrerequisite( nLangType, nLangList) &&
- (lcl_isScriptTypeRequested( nLangType, nLangList) ||
- (bool(nLangList & SvxLanguageListFlags::FBD_CHARS) &&
- MsLangId::hasForbiddenCharacters(nLangType)) ||
- (bool(nLangList & SvxLanguageListFlags::SPELL_AVAIL) &&
- lcl_SeqHasLang(aSpellAvailLang, nLangType)) ||
- (bool(nLangList & SvxLanguageListFlags::HYPH_AVAIL) &&
- lcl_SeqHasLang(aHyphAvailLang, nLangType)) ||
- (bool(nLangList & SvxLanguageListFlags::THES_AVAIL) &&
- lcl_SeqHasLang(aThesAvailLang, nLangType)) ||
- (bool(nLangList & SvxLanguageListFlags::SPELL_USED) &&
- lcl_SeqHasLang(aSpellUsedLang, (sal_uInt16)nLangType)) ||
- (bool(nLangList & SvxLanguageListFlags::HYPH_USED) &&
- lcl_SeqHasLang(aHyphUsedLang, nLangType)) ||
- (bool(nLangList & SvxLanguageListFlags::THES_USED) &&
- lcl_SeqHasLang(aThesUsedLang, nLangType))) )
- InsertLanguage( nLangType );
+ }
+ if (SvxLanguageListFlags::THES_USED & nLangList)
+ {
+ Reference< XThesaurus > xTmp( LinguMgr::GetThesaurus() );
+ if (xTmp.is()) {
+ Sequence < css::lang::Locale > aLocaleSequence( xTmp->getLocales() );
+ aThesUsedLang = lcl_LocaleSeqToLangSeq( aLocaleSequence );
}
+ }
- if (bAddAvailable)
- {
- // Spell checkers, hyphenators and thesauri may add language tags
- // unknown so far.
- AddLanguages( aSpellAvailLang, nLangList);
- AddLanguages( aHyphAvailLang, nLangList);
- AddLanguages( aThesAvailLang, nLangList);
- }
+ std::vector<LanguageType> aKnown;
+ sal_uInt32 nCount;
+ if ( nLangList & SvxLanguageListFlags::ONLY_KNOWN )
+ {
+ aKnown = LocaleDataWrapper::getInstalledLanguageTypes();
+ nCount = aKnown.size();
+ }
+ else
+ {
+ nCount = SvtLanguageTable::GetLanguageEntryCount();
+ }
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
+ {
+ LanguageType nLangType;
+ if ( nLangList & SvxLanguageListFlags::ONLY_KNOWN )
+ nLangType = aKnown[i];
+ else
+ nLangType = SvtLanguageTable::GetLanguageTypeAtIndex( i );
+ if ( lcl_isPrerequisite( nLangType, nLangList) &&
+ (lcl_isScriptTypeRequested( nLangType, nLangList) ||
+ (bool(nLangList & SvxLanguageListFlags::FBD_CHARS) &&
+ MsLangId::hasForbiddenCharacters(nLangType)) ||
+ (bool(nLangList & SvxLanguageListFlags::SPELL_AVAIL) &&
+ lcl_SeqHasLang(aSpellAvailLang, nLangType)) ||
+ (bool(nLangList & SvxLanguageListFlags::HYPH_AVAIL) &&
+ lcl_SeqHasLang(aHyphAvailLang, nLangType)) ||
+ (bool(nLangList & SvxLanguageListFlags::THES_AVAIL) &&
+ lcl_SeqHasLang(aThesAvailLang, nLangType)) ||
+ (bool(nLangList & SvxLanguageListFlags::SPELL_USED) &&
+ lcl_SeqHasLang(aSpellUsedLang, (sal_uInt16)nLangType)) ||
+ (bool(nLangList & SvxLanguageListFlags::HYPH_USED) &&
+ lcl_SeqHasLang(aHyphUsedLang, nLangType)) ||
+ (bool(nLangList & SvxLanguageListFlags::THES_USED) &&
+ lcl_SeqHasLang(aThesUsedLang, nLangType))) )
+ InsertLanguage( nLangType );
+ }
- if (bHasLangNone)
- InsertLanguage( LANGUAGE_NONE );
+ if (bAddAvailable)
+ {
+ // Spell checkers, hyphenators and thesauri may add language tags
+ // unknown so far.
+ AddLanguages( aSpellAvailLang, nLangList);
+ AddLanguages( aHyphAvailLang, nLangList);
+ AddLanguages( aThesAvailLang, nLangList);
}
+
+ if (bHasLangNone)
+ InsertLanguage( LANGUAGE_NONE );
}
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index 2aed4d22e4f8..f31f110b99f2 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -323,48 +323,48 @@ void E3dObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti
// Movement in X, Y in the eye coordinate system
E3dScene* pScene = GetScene();
- if(pScene)
- {
- // transform pos from 2D world to 3D eye
- const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
- basegfx::B2DPoint aScaleCenter2D((double)rRef.X(), (double)rRef.Y());
- basegfx::B2DHomMatrix aInverseSceneTransform(rVCScene.getObjectTransformation());
-
- aInverseSceneTransform.invert();
- aScaleCenter2D = aInverseSceneTransform * aScaleCenter2D;
-
- basegfx::B3DPoint aScaleCenter3D(aScaleCenter2D.getX(), aScaleCenter2D.getY(), 0.5);
- basegfx::B3DHomMatrix aInverseViewToEye(aViewInfo3D.getDeviceToView() * aViewInfo3D.getProjection());
-
- aInverseViewToEye.invert();
- aScaleCenter3D = aInverseViewToEye * aScaleCenter3D;
-
- // Get scale factors
- double fScaleX(xFact);
- double fScaleY(yFact);
-
- // build transform
- basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation());
- aInverseOrientation.invert();
- basegfx::B3DHomMatrix aFullTransform(GetFullTransform());
- basegfx::B3DHomMatrix aTrans(aFullTransform);
-
- aTrans *= aViewInfo3D.getOrientation();
- aTrans.translate(-aScaleCenter3D.getX(), -aScaleCenter3D.getY(), -aScaleCenter3D.getZ());
- aTrans.scale(fScaleX, fScaleY, 1.0);
- aTrans.translate(aScaleCenter3D.getX(), aScaleCenter3D.getY(), aScaleCenter3D.getZ());
- aTrans *= aInverseOrientation;
- aFullTransform.invert();
- aTrans *= aFullTransform;
-
- // Apply
- basegfx::B3DHomMatrix aObjTrans(GetTransform());
- aObjTrans *= aTrans;
-
- E3DModifySceneSnapRectUpdater aUpdater(this);
- SetTransform(aObjTrans);
- }
+ if(!pScene)
+ return;
+
+ // transform pos from 2D world to 3D eye
+ const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
+ basegfx::B2DPoint aScaleCenter2D((double)rRef.X(), (double)rRef.Y());
+ basegfx::B2DHomMatrix aInverseSceneTransform(rVCScene.getObjectTransformation());
+
+ aInverseSceneTransform.invert();
+ aScaleCenter2D = aInverseSceneTransform * aScaleCenter2D;
+
+ basegfx::B3DPoint aScaleCenter3D(aScaleCenter2D.getX(), aScaleCenter2D.getY(), 0.5);
+ basegfx::B3DHomMatrix aInverseViewToEye(aViewInfo3D.getDeviceToView() * aViewInfo3D.getProjection());
+
+ aInverseViewToEye.invert();
+ aScaleCenter3D = aInverseViewToEye * aScaleCenter3D;
+
+ // Get scale factors
+ double fScaleX(xFact);
+ double fScaleY(yFact);
+
+ // build transform
+ basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation());
+ aInverseOrientation.invert();
+ basegfx::B3DHomMatrix aFullTransform(GetFullTransform());
+ basegfx::B3DHomMatrix aTrans(aFullTransform);
+
+ aTrans *= aViewInfo3D.getOrientation();
+ aTrans.translate(-aScaleCenter3D.getX(), -aScaleCenter3D.getY(), -aScaleCenter3D.getZ());
+ aTrans.scale(fScaleX, fScaleY, 1.0);
+ aTrans.translate(aScaleCenter3D.getX(), aScaleCenter3D.getY(), aScaleCenter3D.getZ());
+ aTrans *= aInverseOrientation;
+ aFullTransform.invert();
+ aTrans *= aFullTransform;
+
+ // Apply
+ basegfx::B3DHomMatrix aObjTrans(GetTransform());
+ aObjTrans *= aTrans;
+
+ E3DModifySceneSnapRectUpdater aUpdater(this);
+ SetTransform(aObjTrans);
}
@@ -375,49 +375,49 @@ void E3dObject::NbcMove(const Size& rSize)
// Movement in X, Y in the eye coordinate system
E3dScene* pScene = GetScene();
- if(pScene)
- {
- //Dimensions of the scene in 3D and 2D for comparison
- tools::Rectangle aRect = pScene->GetSnapRect();
+ if(!pScene)
+ return;
- basegfx::B3DHomMatrix aInvDispTransform;
- if(GetParentObj())
- {
- aInvDispTransform = GetParentObj()->GetFullTransform();
- aInvDispTransform.invert();
- }
+ //Dimensions of the scene in 3D and 2D for comparison
+ tools::Rectangle aRect = pScene->GetSnapRect();
- // BoundVolume from 3d world to 3d eye
- const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
- basegfx::B3DRange aEyeVol(pScene->GetBoundVolume());
- aEyeVol.transform(aViewInfo3D.getOrientation());
+ basegfx::B3DHomMatrix aInvDispTransform;
+ if(GetParentObj())
+ {
+ aInvDispTransform = GetParentObj()->GetFullTransform();
+ aInvDispTransform.invert();
+ }
- if ((aRect.GetWidth() == 0) || (aRect.GetHeight() == 0))
- throw o3tl::divide_by_zero();
+ // BoundVolume from 3d world to 3d eye
+ const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
+ basegfx::B3DRange aEyeVol(pScene->GetBoundVolume());
+ aEyeVol.transform(aViewInfo3D.getOrientation());
- // build relative movement vector in eye coordinates
- basegfx::B3DPoint aMove(
- (double)rSize.Width() * aEyeVol.getWidth() / (double)aRect.GetWidth(),
- (double)-rSize.Height() * aEyeVol.getHeight() / (double)aRect.GetHeight(),
- 0.0);
- basegfx::B3DPoint aPos(0.0, 0.0, 0.0);
+ if ((aRect.GetWidth() == 0) || (aRect.GetHeight() == 0))
+ throw o3tl::divide_by_zero();
- // movement vector to local coordinates of objects' parent
- basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation());
- aInverseOrientation.invert();
- basegfx::B3DHomMatrix aCompleteTrans(aInvDispTransform * aInverseOrientation);
+ // build relative movement vector in eye coordinates
+ basegfx::B3DPoint aMove(
+ (double)rSize.Width() * aEyeVol.getWidth() / (double)aRect.GetWidth(),
+ (double)-rSize.Height() * aEyeVol.getHeight() / (double)aRect.GetHeight(),
+ 0.0);
+ basegfx::B3DPoint aPos(0.0, 0.0, 0.0);
- aMove = aCompleteTrans * aMove;
- aPos = aCompleteTrans * aPos;
+ // movement vector to local coordinates of objects' parent
+ basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation());
+ aInverseOrientation.invert();
+ basegfx::B3DHomMatrix aCompleteTrans(aInvDispTransform * aInverseOrientation);
- // build transformation and apply
- basegfx::B3DHomMatrix aTranslate;
- aTranslate.translate(aMove.getX() - aPos.getX(), aMove.getY() - aPos.getY(), aMove.getZ() - aPos.getZ());
+ aMove = aCompleteTrans * aMove;
+ aPos = aCompleteTrans * aPos;
- E3DModifySceneSnapRectUpdater aUpdater(pScene);
- SetTransform(aTranslate * GetTransform());
- }
+ // build transformation and apply
+ basegfx::B3DHomMatrix aTranslate;
+ aTranslate.translate(aMove.getX() - aPos.getX(), aMove.getY() - aPos.getY(), aMove.getZ() - aPos.getZ());
+
+ E3DModifySceneSnapRectUpdater aUpdater(pScene);
+ SetTransform(aTranslate * GetTransform());
}
// Return the sublist, but only if it contains objects!
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 2403e9b4431b..797588a097fe 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -827,172 +827,172 @@ void E3dView::ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, bool bExtrude
void E3dView::ConvertMarkedObjTo3D(bool bExtrude, const basegfx::B2DPoint& rPnt1, const basegfx::B2DPoint& rPnt2)
{
- if(AreObjectsMarked())
- {
- // Create undo
- if(bExtrude)
- BegUndo(SvxResId(RID_SVX_3D_UNDO_EXTRUDE));
- else
- BegUndo(SvxResId(RID_SVX_3D_UNDO_LATHE));
+ if(!AreObjectsMarked())
+ return;
- // Create a new scene for the created 3D object
- E3dScene* pScene = new E3dScene;
+ // Create undo
+ if(bExtrude)
+ BegUndo(SvxResId(RID_SVX_3D_UNDO_EXTRUDE));
+ else
+ BegUndo(SvxResId(RID_SVX_3D_UNDO_LATHE));
- // Determine rectangle and possibly correct it
- tools::Rectangle aRect = GetAllMarkedRect();
- if(aRect.GetWidth() <= 1)
- aRect.SetSize(Size(500, aRect.GetHeight()));
- if(aRect.GetHeight() <= 1)
- aRect.SetSize(Size(aRect.GetWidth(), 500));
+ // Create a new scene for the created 3D object
+ E3dScene* pScene = new E3dScene;
- // Determine the depth relative to the size of the selection
- double fDepth = 0.0;
- double fRot3D = 0.0;
- basegfx::B2DHomMatrix aLatheMat;
+ // Determine rectangle and possibly correct it
+ tools::Rectangle aRect = GetAllMarkedRect();
+ if(aRect.GetWidth() <= 1)
+ aRect.SetSize(Size(500, aRect.GetHeight()));
+ if(aRect.GetHeight() <= 1)
+ aRect.SetSize(Size(aRect.GetWidth(), 500));
- if(bExtrude)
- {
- double fW = (double)aRect.GetWidth();
- double fH = (double)aRect.GetHeight();
- fDepth = sqrt(fW*fW + fH*fH) / 6.0;
- }
- if(!bExtrude)
- {
- // Create transformation for the polygons rotating body
- if (rPnt1 != rPnt2)
- {
- // Rotation around control point #1 with set angle
- // for 3D coordinates
- basegfx::B2DPoint aDiff(rPnt1 - rPnt2);
- fRot3D = atan2(aDiff.getY(), aDiff.getX()) - F_PI2;
+ // Determine the depth relative to the size of the selection
+ double fDepth = 0.0;
+ double fRot3D = 0.0;
+ basegfx::B2DHomMatrix aLatheMat;
- if(basegfx::fTools::equalZero(fabs(fRot3D)))
- fRot3D = 0.0;
+ if(bExtrude)
+ {
+ double fW = (double)aRect.GetWidth();
+ double fH = (double)aRect.GetHeight();
+ fDepth = sqrt(fW*fW + fH*fH) / 6.0;
+ }
+ if(!bExtrude)
+ {
+ // Create transformation for the polygons rotating body
+ if (rPnt1 != rPnt2)
+ {
+ // Rotation around control point #1 with set angle
+ // for 3D coordinates
+ basegfx::B2DPoint aDiff(rPnt1 - rPnt2);
+ fRot3D = atan2(aDiff.getY(), aDiff.getX()) - F_PI2;
- if(fRot3D != 0.0)
- {
- aLatheMat = basegfx::utils::createRotateAroundPoint(rPnt2, -fRot3D)
- * aLatheMat;
- }
- }
+ if(basegfx::fTools::equalZero(fabs(fRot3D)))
+ fRot3D = 0.0;
- if (rPnt2.getX() != 0.0)
+ if(fRot3D != 0.0)
{
- // Translation to Y=0 - axis
- aLatheMat.translate(-rPnt2.getX(), 0.0);
+ aLatheMat = basegfx::utils::createRotateAroundPoint(rPnt2, -fRot3D)
+ * aLatheMat;
}
- else
- {
- aLatheMat.translate((double)-aRect.Left(), 0.0);
- }
-
- // Form the inverse matrix to determine the target expansion
- basegfx::B2DHomMatrix aInvLatheMat(aLatheMat);
- aInvLatheMat.invert();
+ }
- // SnapRect extension enables mirroring in the axis of rotation
- for(size_t a=0; a<GetMarkedObjectCount(); ++a)
- {
- SdrMark* pMark = GetSdrMarkByIndex(a);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
- tools::Rectangle aTurnRect = pObj->GetSnapRect();
- basegfx::B2DPoint aRot;
- Point aRotPnt;
-
- aRot = basegfx::B2DPoint(aTurnRect.Left(), -aTurnRect.Top());
- aRot *= aLatheMat;
- aRot.setX(-aRot.getX());
- aRot *= aInvLatheMat;
- aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
- aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
-
- aRot = basegfx::B2DPoint(aTurnRect.Left(), -aTurnRect.Bottom());
- aRot *= aLatheMat;
- aRot.setX(-aRot.getX());
- aRot *= aInvLatheMat;
- aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
- aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
-
- aRot = basegfx::B2DPoint(aTurnRect.Right(), -aTurnRect.Top());
- aRot *= aLatheMat;
- aRot.setX(-aRot.getX());
- aRot *= aInvLatheMat;
- aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
- aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
-
- aRot = basegfx::B2DPoint(aTurnRect.Right(), -aTurnRect.Bottom());
- aRot *= aLatheMat;
- aRot.setX(-aRot.getX());
- aRot *= aInvLatheMat;
- aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
- aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
- }
+ if (rPnt2.getX() != 0.0)
+ {
+ // Translation to Y=0 - axis
+ aLatheMat.translate(-rPnt2.getX(), 0.0);
+ }
+ else
+ {
+ aLatheMat.translate((double)-aRect.Left(), 0.0);
}
- // Walk through the selection and convert it into 3D, complete with
- // Conversion to SdrPathObject, also fonts
+ // Form the inverse matrix to determine the target expansion
+ basegfx::B2DHomMatrix aInvLatheMat(aLatheMat);
+ aInvLatheMat.invert();
+
+ // SnapRect extension enables mirroring in the axis of rotation
for(size_t a=0; a<GetMarkedObjectCount(); ++a)
{
SdrMark* pMark = GetSdrMarkByIndex(a);
SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- ImpCreate3DObject(pScene, pObj, bExtrude, fDepth, aLatheMat);
+ tools::Rectangle aTurnRect = pObj->GetSnapRect();
+ basegfx::B2DPoint aRot;
+ Point aRotPnt;
+
+ aRot = basegfx::B2DPoint(aTurnRect.Left(), -aTurnRect.Top());
+ aRot *= aLatheMat;
+ aRot.setX(-aRot.getX());
+ aRot *= aInvLatheMat;
+ aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
+ aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
+
+ aRot = basegfx::B2DPoint(aTurnRect.Left(), -aTurnRect.Bottom());
+ aRot *= aLatheMat;
+ aRot.setX(-aRot.getX());
+ aRot *= aInvLatheMat;
+ aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
+ aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
+
+ aRot = basegfx::B2DPoint(aTurnRect.Right(), -aTurnRect.Top());
+ aRot *= aLatheMat;
+ aRot.setX(-aRot.getX());
+ aRot *= aInvLatheMat;
+ aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
+ aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
+
+ aRot = basegfx::B2DPoint(aTurnRect.Right(), -aTurnRect.Bottom());
+ aRot *= aLatheMat;
+ aRot.setX(-aRot.getX());
+ aRot *= aInvLatheMat;
+ aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
+ aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
}
+ }
- if(pScene->GetSubList() && pScene->GetSubList()->GetObjCount() != 0)
- {
- // Arrange all created objects by depth
- if(bExtrude)
- DoDepthArrange(pScene, fDepth);
-
- // Center 3D objects in the middle of the overall rectangle
- basegfx::B3DPoint aCenter(pScene->GetBoundVolume().getCenter());
- basegfx::B3DHomMatrix aMatrix;
-
- aMatrix.translate(-aCenter.getX(), -aCenter.getY(), -aCenter.getZ());
- pScene->SetTransform(aMatrix * pScene->GetTransform());
-
- // Initialize scene
- pScene->NbcSetSnapRect(aRect);
- basegfx::B3DRange aBoundVol = pScene->GetBoundVolume();
- InitScene(pScene, (double)aRect.GetWidth(), (double)aRect.GetHeight(), aBoundVol.getDepth());
-
- // Insert scene instead of the first selected object and throw away
- // all the old objects
- SdrObject* pRepObj = GetMarkedObjectByIndex(0);
- SdrPageView* pPV = GetSdrPageViewOfMarkedByIndex(0);
- MarkObj(pRepObj, pPV, true);
- ReplaceObjectAtView(pRepObj, *pPV, pScene, false);
- DeleteMarked();
- MarkObj(pScene, pPV);
-
- // Rotate Rotation body around the axis of rotation
- basegfx::B3DHomMatrix aRotate;
-
- if(!bExtrude && fRot3D != 0.0)
- {
- aRotate.rotate(0.0, 0.0, fRot3D);
- }
+ // Walk through the selection and convert it into 3D, complete with
+ // Conversion to SdrPathObject, also fonts
+ for(size_t a=0; a<GetMarkedObjectCount(); ++a)
+ {
+ SdrMark* pMark = GetSdrMarkByIndex(a);
+ SdrObject* pObj = pMark->GetMarkedSdrObj();
- // Set default rotation
- aRotate.rotate(DEG2RAD(20.0), 0.0, 0.0);
+ ImpCreate3DObject(pScene, pObj, bExtrude, fDepth, aLatheMat);
+ }
- if(!aRotate.isIdentity())
- {
- pScene->SetTransform(aRotate * pScene->GetTransform());
- }
+ if(pScene->GetSubList() && pScene->GetSubList()->GetObjCount() != 0)
+ {
+ // Arrange all created objects by depth
+ if(bExtrude)
+ DoDepthArrange(pScene, fDepth);
+
+ // Center 3D objects in the middle of the overall rectangle
+ basegfx::B3DPoint aCenter(pScene->GetBoundVolume().getCenter());
+ basegfx::B3DHomMatrix aMatrix;
+
+ aMatrix.translate(-aCenter.getX(), -aCenter.getY(), -aCenter.getZ());
+ pScene->SetTransform(aMatrix * pScene->GetTransform());
+
+ // Initialize scene
+ pScene->NbcSetSnapRect(aRect);
+ basegfx::B3DRange aBoundVol = pScene->GetBoundVolume();
+ InitScene(pScene, (double)aRect.GetWidth(), (double)aRect.GetHeight(), aBoundVol.getDepth());
+
+ // Insert scene instead of the first selected object and throw away
+ // all the old objects
+ SdrObject* pRepObj = GetMarkedObjectByIndex(0);
+ SdrPageView* pPV = GetSdrPageViewOfMarkedByIndex(0);
+ MarkObj(pRepObj, pPV, true);
+ ReplaceObjectAtView(pRepObj, *pPV, pScene, false);
+ DeleteMarked();
+ MarkObj(pScene, pPV);
+
+ // Rotate Rotation body around the axis of rotation
+ basegfx::B3DHomMatrix aRotate;
- // Invalid SnapRects of objects
- pScene->SetSnapRect(aRect);
+ if(!bExtrude && fRot3D != 0.0)
+ {
+ aRotate.rotate(0.0, 0.0, fRot3D);
}
- else
+
+ // Set default rotation
+ aRotate.rotate(DEG2RAD(20.0), 0.0, 0.0);
+
+ if(!aRotate.isIdentity())
{
- // No 3D object was created, throw away everything
- delete pScene;
+ pScene->SetTransform(aRotate * pScene->GetTransform());
}
- EndUndo();
+ // Invalid SnapRects of objects
+ pScene->SetSnapRect(aRect);
}
+ else
+ {
+ // No 3D object was created, throw away everything
+ delete pScene;
+ }
+
+ EndUndo();
}
//Arrange all created extrude objects by depth
@@ -1325,92 +1325,92 @@ void E3dView::InitScene(E3dScene* pScene, double fW, double fH, double fCamZ)
void E3dView::Start3DCreation()
{
- if (GetMarkedObjectCount())
+ if (!GetMarkedObjectCount())
+ return;
+
+ //positioned
+ long nOutMin = 0;
+ long nOutMax = 0;
+ long nMinLen = 0;
+ long nObjDst = 0;
+ long nOutHgt = 0;
+ OutputDevice* pOut = GetFirstOutputDevice();
+
+ // first determine representation boundaries
+ if (pOut != nullptr)
{
- //positioned
- long nOutMin = 0;
- long nOutMax = 0;
- long nMinLen = 0;
- long nObjDst = 0;
- long nOutHgt = 0;
- OutputDevice* pOut = GetFirstOutputDevice();
-
- // first determine representation boundaries
- if (pOut != nullptr)
- {
- nMinLen = pOut->PixelToLogic(Size(0,50)).Height();
- nObjDst = pOut->PixelToLogic(Size(0,20)).Height();
+ nMinLen = pOut->PixelToLogic(Size(0,50)).Height();
+ nObjDst = pOut->PixelToLogic(Size(0,20)).Height();
- long nDst = pOut->PixelToLogic(Size(0,10)).Height();
+ long nDst = pOut->PixelToLogic(Size(0,10)).Height();
- nOutMin = -pOut->GetMapMode().GetOrigin().Y();
- nOutMax = pOut->GetOutputSize().Height() - 1 + nOutMin;
- nOutMin += nDst;
- nOutMax -= nDst;
+ nOutMin = -pOut->GetMapMode().GetOrigin().Y();
+ nOutMax = pOut->GetOutputSize().Height() - 1 + nOutMin;
+ nOutMin += nDst;
+ nOutMax -= nDst;
- if (nOutMax - nOutMin < nDst)
- {
- nOutMin += nOutMax + 1;
- nOutMin /= 2;
- nOutMin -= (nDst + 1) / 2;
- nOutMax = nOutMin + nDst;
- }
+ if (nOutMax - nOutMin < nDst)
+ {
+ nOutMin += nOutMax + 1;
+ nOutMin /= 2;
+ nOutMin -= (nDst + 1) / 2;
+ nOutMax = nOutMin + nDst;
+ }
- nOutHgt = nOutMax - nOutMin;
+ nOutHgt = nOutMax - nOutMin;
- long nTemp = nOutHgt / 4;
- if (nTemp > nMinLen) nMinLen = nTemp;
- }
+ long nTemp = nOutHgt / 4;
+ if (nTemp > nMinLen) nMinLen = nTemp;
+ }
- // and then attach the marks at the top and bottom of the object
- basegfx::B2DRange aR;
- for(size_t nMark = 0; nMark < GetMarkedObjectCount(); ++nMark)
- {
- SdrObject* pMark = GetMarkedObjectByIndex(nMark);
- basegfx::B2DPolyPolygon aXPP(pMark->TakeXorPoly());
- aR.expand(basegfx::utils::getRange(aXPP));
- }
+ // and then attach the marks at the top and bottom of the object
+ basegfx::B2DRange aR;
+ for(size_t nMark = 0; nMark < GetMarkedObjectCount(); ++nMark)
+ {
+ SdrObject* pMark = GetMarkedObjectByIndex(nMark);
+ basegfx::B2DPolyPolygon aXPP(pMark->TakeXorPoly());
+ aR.expand(basegfx::utils::getRange(aXPP));
+ }
- basegfx::B2DPoint aCenter(aR.getCenter());
- long nMarkHgt = basegfx::fround(aR.getHeight()) - 1;
- long nHgt = nMarkHgt + nObjDst * 2;
+ basegfx::B2DPoint aCenter(aR.getCenter());
+ long nMarkHgt = basegfx::fround(aR.getHeight()) - 1;
+ long nHgt = nMarkHgt + nObjDst * 2;
- if (nHgt < nMinLen) nHgt = nMinLen;
+ if (nHgt < nMinLen) nHgt = nMinLen;
- long nY1 = basegfx::fround(aCenter.getY()) - (nHgt + 1) / 2;
- long nY2 = nY1 + nHgt;
+ long nY1 = basegfx::fround(aCenter.getY()) - (nHgt + 1) / 2;
+ long nY2 = nY1 + nHgt;
- if (pOut && (nMinLen > nOutHgt)) nMinLen = nOutHgt;
- if (pOut)
+ if (pOut && (nMinLen > nOutHgt)) nMinLen = nOutHgt;
+ if (pOut)
+ {
+ if (nY1 < nOutMin)
{
- if (nY1 < nOutMin)
- {
- nY1 = nOutMin;
- if (nY2 < nY1 + nMinLen) nY2 = nY1 + nMinLen;
- }
- if (nY2 > nOutMax)
- {
- nY2 = nOutMax;
- if (nY1 > nY2 - nMinLen) nY1 = nY2 - nMinLen;
- }
+ nY1 = nOutMin;
+ if (nY2 < nY1 + nMinLen) nY2 = nY1 + nMinLen;
}
+ if (nY2 > nOutMax)
+ {
+ nY2 = nOutMax;
+ if (nY1 > nY2 - nMinLen) nY1 = nY2 - nMinLen;
+ }
+ }
- maRef1.X() = basegfx::fround(aR.getMinX()); // Initial move axis 2/100mm to the left
- maRef1.Y() = nY1;
- maRef2.X() = maRef1.X();
- maRef2.Y() = nY2;
+ maRef1.X() = basegfx::fround(aR.getMinX()); // Initial move axis 2/100mm to the left
+ maRef1.Y() = nY1;
+ maRef2.X() = maRef1.X();
+ maRef2.Y() = nY2;
- // Turn on marks
- SetMarkHandles(nullptr);
+ // Turn on marks
+ SetMarkHandles(nullptr);
- //HMHif (bVis) ShowMarkHdl();
- if (AreObjectsMarked()) MarkListHasChanged();
+ //HMHif (bVis) ShowMarkHdl();
+ if (AreObjectsMarked()) MarkListHasChanged();
- // Show mirror polygon IMMEDIATELY
- const SdrHdlList &aHdlList = GetHdlList();
- mpMirrorOverlay = new Impl3DMirrorConstructOverlay(*this);
- mpMirrorOverlay->SetMirrorAxis(aHdlList.GetHdl(SdrHdlKind::Ref1)->GetPos(), aHdlList.GetHdl(SdrHdlKind::Ref2)->GetPos());
- }
+ // Show mirror polygon IMMEDIATELY
+ const SdrHdlList &aHdlList = GetHdlList();
+ mpMirrorOverlay = new Impl3DMirrorConstructOverlay(*this);
+ mpMirrorOverlay->SetMirrorAxis(aHdlList.GetHdl(SdrHdlKind::Ref1)->GetPos(), aHdlList.GetHdl(SdrHdlKind::Ref2)->GetPos());
}
// what happens with a mouse movement when the object is created?
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 9ae075f7099f..7da52af19012 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -535,44 +535,44 @@ DbCellControl::DbCellControl( DbGridColumn& _rColumn )
,m_pWindow( nullptr )
{
Reference< XPropertySet > xColModelProps( _rColumn.getModel(), UNO_QUERY );
- if ( xColModelProps.is() )
- {
- // if our model's format key changes we want to propagate the new value to our windows
- m_pModelChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, Reference< css::beans::XPropertySet > (_rColumn.getModel(), UNO_QUERY));
-
- // be listener for some common properties
- implDoPropertyListening( FM_PROP_READONLY, false );
- implDoPropertyListening( FM_PROP_ENABLED, false );
-
- // add as listener for all known "value" properties
- implDoPropertyListening( FM_PROP_VALUE, false );
- implDoPropertyListening( FM_PROP_STATE, false );
- implDoPropertyListening( FM_PROP_TEXT, false );
- implDoPropertyListening( FM_PROP_EFFECTIVE_VALUE, false );
- implDoPropertyListening( FM_PROP_SELECT_SEQ, false );
- implDoPropertyListening( FM_PROP_DATE, false );
- implDoPropertyListening( FM_PROP_TIME, false );
+ if ( !xColModelProps.is() )
+ return;
- // be listener at the bound field as well
- try
+ // if our model's format key changes we want to propagate the new value to our windows
+ m_pModelChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, Reference< css::beans::XPropertySet > (_rColumn.getModel(), UNO_QUERY));
+
+ // be listener for some common properties
+ implDoPropertyListening( FM_PROP_READONLY, false );
+ implDoPropertyListening( FM_PROP_ENABLED, false );
+
+ // add as listener for all known "value" properties
+ implDoPropertyListening( FM_PROP_VALUE, false );
+ implDoPropertyListening( FM_PROP_STATE, false );
+ implDoPropertyListening( FM_PROP_TEXT, false );
+ implDoPropertyListening( FM_PROP_EFFECTIVE_VALUE, false );
+ implDoPropertyListening( FM_PROP_SELECT_SEQ, false );
+ implDoPropertyListening( FM_PROP_DATE, false );
+ implDoPropertyListening( FM_PROP_TIME, false );
+
+ // be listener at the bound field as well
+ try
+ {
+ Reference< XPropertySetInfo > xPSI( xColModelProps->getPropertySetInfo(), UNO_SET_THROW );
+ if ( xPSI->hasPropertyByName( FM_PROP_BOUNDFIELD ) )
{
- Reference< XPropertySetInfo > xPSI( xColModelProps->getPropertySetInfo(), UNO_SET_THROW );
- if ( xPSI->hasPropertyByName( FM_PROP_BOUNDFIELD ) )
+ Reference< XPropertySet > xField;
+ xColModelProps->getPropertyValue( FM_PROP_BOUNDFIELD ) >>= xField;
+ if ( xField.is() )
{
- Reference< XPropertySet > xField;
- xColModelProps->getPropertyValue( FM_PROP_BOUNDFIELD ) >>= xField;
- if ( xField.is() )
- {
- m_pFieldChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, xField);
- m_pFieldChangeBroadcaster->addProperty( FM_PROP_ISREADONLY );
- }
+ m_pFieldChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, xField);
+ m_pFieldChangeBroadcaster->addProperty( FM_PROP_ISREADONLY );
}
}
- catch( const Exception& )
- {
- OSL_FAIL( "DbCellControl::doPropertyListening: caught an exception!" );
- DBG_UNHANDLED_EXCEPTION();
- }
+ }
+ catch( const Exception& )
+ {
+ OSL_FAIL( "DbCellControl::doPropertyListening: caught an exception!" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -1718,23 +1718,23 @@ void DbPatternField::implAdjustGenericFieldSetting( const Reference< XPropertySe
{
DBG_ASSERT( m_pWindow, "DbPatternField::implAdjustGenericFieldSetting: not to be called without window!" );
DBG_ASSERT( _rxModel.is(), "DbPatternField::implAdjustGenericFieldSetting: invalid model!" );
- if ( m_pWindow && _rxModel.is() )
- {
- OUString aLitMask;
- OUString aEditMask;
- bool bStrict = false;
+ if ( !m_pWindow || !_rxModel.is() )
+ return;
- _rxModel->getPropertyValue( FM_PROP_LITERALMASK ) >>= aLitMask;
- _rxModel->getPropertyValue( FM_PROP_EDITMASK ) >>= aEditMask;
- _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) >>= bStrict;
+ OUString aLitMask;
+ OUString aEditMask;
+ bool bStrict = false;
- OString aAsciiEditMask(OUStringToOString(aEditMask, RTL_TEXTENCODING_ASCII_US));
+ _rxModel->getPropertyValue( FM_PROP_LITERALMASK ) >>= aLitMask;
+ _rxModel->getPropertyValue( FM_PROP_EDITMASK ) >>= aEditMask;
+ _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) >>= bStrict;
- static_cast< PatternField* >( m_pWindow.get() )->SetMask( aAsciiEditMask, aLitMask );
- static_cast< PatternField* >( m_pPainter.get() )->SetMask( aAsciiEditMask, aLitMask );
- static_cast< PatternField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
- static_cast< PatternField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
- }
+ OString aAsciiEditMask(OUStringToOString(aEditMask, RTL_TEXTENCODING_ASCII_US));
+
+ static_cast< PatternField* >( m_pWindow.get() )->SetMask( aAsciiEditMask, aLitMask );
+ static_cast< PatternField* >( m_pPainter.get() )->SetMask( aAsciiEditMask, aLitMask );
+ static_cast< PatternField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
+ static_cast< PatternField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
}
@@ -1865,54 +1865,54 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe
{
DBG_ASSERT( m_pWindow, "DbNumericField::implAdjustGenericFieldSetting: not to be called without window!" );
DBG_ASSERT( _rxModel.is(), "DbNumericField::implAdjustGenericFieldSetting: invalid model!" );
- if ( m_pWindow && _rxModel.is() )
+ if ( !m_pWindow || !_rxModel.is() )
+ return;
+
+ sal_Int32 nMin = (sal_Int32)getDouble( _rxModel->getPropertyValue( FM_PROP_VALUEMIN ) );
+ sal_Int32 nMax = (sal_Int32)getDouble( _rxModel->getPropertyValue( FM_PROP_VALUEMAX ) );
+ sal_Int32 nStep = (sal_Int32)getDouble( _rxModel->getPropertyValue( FM_PROP_VALUESTEP ) );
+ bool bStrict = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) );
+ sal_Int16 nScale = getINT16( _rxModel->getPropertyValue( FM_PROP_DECIMAL_ACCURACY ) );
+ bool bThousand = getBOOL( _rxModel->getPropertyValue( FM_PROP_SHOWTHOUSANDSEP ) );
+
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetMinValue(nMin);
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetMaxValue(nMax);
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetSpinSize(nStep);
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetStrictFormat(bStrict);
+
+ static_cast< DoubleNumericField* >( m_pPainter.get() )->SetMinValue(nMin);
+ static_cast< DoubleNumericField* >( m_pPainter.get() )->SetMaxValue(nMax);
+ static_cast< DoubleNumericField* >( m_pPainter.get() )->SetStrictFormat(bStrict);
+
+
+ // give a formatter to the field and the painter;
+ // test first if I can get from the service behind a connection
+ Reference< css::util::XNumberFormatsSupplier > xSupplier;
+ Reference< XRowSet > xForm;
+ if ( m_rColumn.GetParent().getDataSource() )
+ xForm.set( Reference< XInterface >(*m_rColumn.GetParent().getDataSource()), UNO_QUERY );
+ if ( xForm.is() )
+ xSupplier = getNumberFormats( getConnection( xForm ), true );
+ SvNumberFormatter* pFormatterUsed = nullptr;
+ if ( xSupplier.is() )
{
- sal_Int32 nMin = (sal_Int32)getDouble( _rxModel->getPropertyValue( FM_PROP_VALUEMIN ) );
- sal_Int32 nMax = (sal_Int32)getDouble( _rxModel->getPropertyValue( FM_PROP_VALUEMAX ) );
- sal_Int32 nStep = (sal_Int32)getDouble( _rxModel->getPropertyValue( FM_PROP_VALUESTEP ) );
- bool bStrict = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) );
- sal_Int16 nScale = getINT16( _rxModel->getPropertyValue( FM_PROP_DECIMAL_ACCURACY ) );
- bool bThousand = getBOOL( _rxModel->getPropertyValue( FM_PROP_SHOWTHOUSANDSEP ) );
-
- static_cast< DoubleNumericField* >( m_pWindow.get() )->SetMinValue(nMin);
- static_cast< DoubleNumericField* >( m_pWindow.get() )->SetMaxValue(nMax);
- static_cast< DoubleNumericField* >( m_pWindow.get() )->SetSpinSize(nStep);
- static_cast< DoubleNumericField* >( m_pWindow.get() )->SetStrictFormat(bStrict);
-
- static_cast< DoubleNumericField* >( m_pPainter.get() )->SetMinValue(nMin);
- static_cast< DoubleNumericField* >( m_pPainter.get() )->SetMaxValue(nMax);
- static_cast< DoubleNumericField* >( m_pPainter.get() )->SetStrictFormat(bStrict);
-
-
- // give a formatter to the field and the painter;
- // test first if I can get from the service behind a connection
- Reference< css::util::XNumberFormatsSupplier > xSupplier;
- Reference< XRowSet > xForm;
- if ( m_rColumn.GetParent().getDataSource() )
- xForm.set( Reference< XInterface >(*m_rColumn.GetParent().getDataSource()), UNO_QUERY );
- if ( xForm.is() )
- xSupplier = getNumberFormats( getConnection( xForm ), true );
- SvNumberFormatter* pFormatterUsed = nullptr;
- if ( xSupplier.is() )
- {
- SvNumberFormatsSupplierObj* pImplmentation = SvNumberFormatsSupplierObj::getImplementation( xSupplier );
- pFormatterUsed = pImplmentation ? pImplmentation->GetNumberFormatter() : nullptr;
- }
- if ( nullptr == pFormatterUsed )
- { // the cursor didn't lead to success -> standard
- pFormatterUsed = static_cast< DoubleNumericField* >( m_pWindow.get() )->StandardFormatter();
- DBG_ASSERT( pFormatterUsed != nullptr, "DbNumericField::implAdjustGenericFieldSetting: no standard formatter given by the numeric field !" );
- }
- static_cast< DoubleNumericField* >( m_pWindow.get() )->SetFormatter( pFormatterUsed );
- static_cast< DoubleNumericField* >( m_pPainter.get() )->SetFormatter( pFormatterUsed );
+ SvNumberFormatsSupplierObj* pImplmentation = SvNumberFormatsSupplierObj::getImplementation( xSupplier );
+ pFormatterUsed = pImplmentation ? pImplmentation->GetNumberFormatter() : nullptr;
+ }
+ if ( nullptr == pFormatterUsed )
+ { // the cursor didn't lead to success -> standard
+ pFormatterUsed = static_cast< DoubleNumericField* >( m_pWindow.get() )->StandardFormatter();
+ DBG_ASSERT( pFormatterUsed != nullptr, "DbNumericField::implAdjustGenericFieldSetting: no standard formatter given by the numeric field !" );
+ }
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetFormatter( pFormatterUsed );
+ static_cast< DoubleNumericField* >( m_pPainter.get() )->SetFormatter( pFormatterUsed );
- // and then generate a format which has the desired length after the decimal point, etc.
- LanguageType aAppLanguage = Application::GetSettings().GetUILanguageTag().getLanguageType();
- OUString sFormatString = pFormatterUsed->GenerateFormat(0, aAppLanguage, bThousand, false, nScale);
+ // and then generate a format which has the desired length after the decimal point, etc.
+ LanguageType aAppLanguage = Application::GetSettings().GetUILanguageTag().getLanguageType();
+ OUString sFormatString = pFormatterUsed->GenerateFormat(0, aAppLanguage, bThousand, false, nScale);
- static_cast< DoubleNumericField* >( m_pWindow.get() )->SetFormat( sFormatString, aAppLanguage );
- static_cast< DoubleNumericField* >( m_pPainter.get() )->SetFormat( sFormatString, aAppLanguage );
- }
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetFormat( sFormatString, aAppLanguage );
+ static_cast< DoubleNumericField* >( m_pPainter.get() )->SetFormat( sFormatString, aAppLanguage );
}
@@ -2005,42 +2005,42 @@ void DbCurrencyField::implAdjustGenericFieldSetting( const Reference< XPropertyS
{
DBG_ASSERT( m_pWindow, "DbCurrencyField::implAdjustGenericFieldSetting: not to be called without window!" );
DBG_ASSERT( _rxModel.is(), "DbCurrencyField::implAdjustGenericFieldSetting: invalid model!" );
- if ( m_pWindow && _rxModel.is() )
- {
- m_nScale = getINT16( _rxModel->getPropertyValue( FM_PROP_DECIMAL_ACCURACY ) );
- double nMin = getDouble( _rxModel->getPropertyValue( FM_PROP_VALUEMIN ) );
- double nMax = getDouble( _rxModel->getPropertyValue( FM_PROP_VALUEMAX ) );
- double nStep = getDouble( _rxModel->getPropertyValue( FM_PROP_VALUESTEP ) );
- bool bStrict = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) );
- bool bThousand = getBOOL( _rxModel->getPropertyValue( FM_PROP_SHOWTHOUSANDSEP ) );
- OUString aStr( getString( _rxModel->getPropertyValue(FM_PROP_CURRENCYSYMBOL ) ) );
-
- //fdo#42747 the min/max/first/last of vcl NumericFormatters needs to be
- //multiplied by the no of decimal places. See also
- //VclBuilder::mungeAdjustment
- int nMul = rtl_math_pow10Exp(1, m_nScale);
- nMin *= nMul;
- nMax *= nMul;
-
- static_cast< LongCurrencyField* >( m_pWindow.get() )->SetUseThousandSep( bThousand );
- static_cast< LongCurrencyField* >( m_pWindow.get() )->SetDecimalDigits( m_nScale );
- static_cast< LongCurrencyField* >( m_pWindow.get() )->SetCurrencySymbol( aStr );
- static_cast< LongCurrencyField* >( m_pWindow.get() )->SetFirst( nMin );
- static_cast< LongCurrencyField* >( m_pWindow.get() )->SetLast( nMax );
- static_cast< LongCurrencyField* >( m_pWindow.get() )->SetMin( nMin );
- static_cast< LongCurrencyField* >( m_pWindow.get() )->SetMax( nMax );
- static_cast< LongCurrencyField* >( m_pWindow.get() )->SetSpinSize( nStep );
- static_cast< LongCurrencyField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
-
- static_cast< LongCurrencyField* >( m_pPainter.get() )->SetUseThousandSep( bThousand );
- static_cast< LongCurrencyField* >( m_pPainter.get() )->SetDecimalDigits( m_nScale );
- static_cast< LongCurrencyField* >( m_pPainter.get() )->SetCurrencySymbol( aStr );
- static_cast< LongCurrencyField* >( m_pPainter.get() )->SetFirst( nMin );
- static_cast< LongCurrencyField* >( m_pPainter.get() )->SetLast( nMax );
- static_cast< LongCurrencyField* >( m_pPainter.get() )->SetMin( nMin );
- static_cast< LongCurrencyField* >( m_pPainter.get() )->SetMax( nMax );
- static_cast< LongCurrencyField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
- }
+ if ( !m_pWindow || !_rxModel.is() )
+ return;
+
+ m_nScale = getINT16( _rxModel->getPropertyValue( FM_PROP_DECIMAL_ACCURACY ) );
+ double nMin = getDouble( _rxModel->getPropertyValue( FM_PROP_VALUEMIN ) );
+ double nMax = getDouble( _rxModel->getPropertyValue( FM_PROP_VALUEMAX ) );
+ double nStep = getDouble( _rxModel->getPropertyValue( FM_PROP_VALUESTEP ) );
+ bool bStrict = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) );
+ bool bThousand = getBOOL( _rxModel->getPropertyValue( FM_PROP_SHOWTHOUSANDSEP ) );
+ OUString aStr( getString( _rxModel->getPropertyValue(FM_PROP_CURRENCYSYMBOL ) ) );
+
+ //fdo#42747 the min/max/first/last of vcl NumericFormatters needs to be
+ //multiplied by the no of decimal places. See also
+ //VclBuilder::mungeAdjustment
+ int nMul = rtl_math_pow10Exp(1, m_nScale);
+ nMin *= nMul;
+ nMax *= nMul;
+
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetUseThousandSep( bThousand );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetDecimalDigits( m_nScale );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetCurrencySymbol( aStr );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetFirst( nMin );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetLast( nMax );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetMin( nMin );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetMax( nMax );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetSpinSize( nStep );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
+
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetUseThousandSep( bThousand );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetDecimalDigits( m_nScale );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetCurrencySymbol( aStr );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetFirst( nMin );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetLast( nMax );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetMin( nMin );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetMax( nMax );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
}
@@ -2171,36 +2171,36 @@ void DbDateField::implAdjustGenericFieldSetting( const Reference< XPropertySet >
{
DBG_ASSERT( m_pWindow, "DbDateField::implAdjustGenericFieldSetting: not to be called without window!" );
DBG_ASSERT( _rxModel.is(), "DbDateField::implAdjustGenericFieldSetting: invalid model!" );
- if ( m_pWindow && _rxModel.is() )
- {
- sal_Int16 nFormat = getINT16( _rxModel->getPropertyValue( FM_PROP_DATEFORMAT ) );
- util::Date aMin;
- OSL_VERIFY( _rxModel->getPropertyValue( FM_PROP_DATEMIN ) >>= aMin );
- util::Date aMax;
- OSL_VERIFY( _rxModel->getPropertyValue( FM_PROP_DATEMAX ) >>= aMax );
- bool bStrict = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) );
+ if ( !m_pWindow || !_rxModel.is() )
+ return;
- Any aCentury = _rxModel->getPropertyValue( FM_PROP_DATE_SHOW_CENTURY );
- if ( aCentury.getValueType().getTypeClass() != TypeClass_VOID )
- {
- bool bShowDateCentury = getBOOL( aCentury );
+ sal_Int16 nFormat = getINT16( _rxModel->getPropertyValue( FM_PROP_DATEFORMAT ) );
+ util::Date aMin;
+ OSL_VERIFY( _rxModel->getPropertyValue( FM_PROP_DATEMIN ) >>= aMin );
+ util::Date aMax;
+ OSL_VERIFY( _rxModel->getPropertyValue( FM_PROP_DATEMAX ) >>= aMax );
+ bool bStrict = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) );
- static_cast<DateField*>( m_pWindow.get() )->SetShowDateCentury( bShowDateCentury );
- static_cast<DateField*>( m_pPainter.get() )->SetShowDateCentury( bShowDateCentury );
- }
-
- static_cast< DateField* >( m_pWindow.get() )->SetExtDateFormat( (ExtDateFieldFormat)nFormat );
- static_cast< DateField* >( m_pWindow.get() )->SetMin( aMin );
- static_cast< DateField* >( m_pWindow.get() )->SetMax( aMax );
- static_cast< DateField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
- static_cast< DateField* >( m_pWindow.get() )->EnableEmptyFieldValue( true );
+ Any aCentury = _rxModel->getPropertyValue( FM_PROP_DATE_SHOW_CENTURY );
+ if ( aCentury.getValueType().getTypeClass() != TypeClass_VOID )
+ {
+ bool bShowDateCentury = getBOOL( aCentury );
- static_cast< DateField* >( m_pPainter.get() )->SetExtDateFormat( (ExtDateFieldFormat)nFormat );
- static_cast< DateField* >( m_pPainter.get() )->SetMin( aMin );
- static_cast< DateField* >( m_pPainter.get() )->SetMax( aMax );
- static_cast< DateField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
- static_cast< DateField* >( m_pPainter.get() )->EnableEmptyFieldValue( true );
+ static_cast<DateField*>( m_pWindow.get() )->SetShowDateCentury( bShowDateCentury );
+ static_cast<DateField*>( m_pPainter.get() )->SetShowDateCentury( bShowDateCentury );
}
+
+ static_cast< DateField* >( m_pWindow.get() )->SetExtDateFormat( (ExtDateFieldFormat)nFormat );
+ static_cast< DateField* >( m_pWindow.get() )->SetMin( aMin );
+ static_cast< DateField* >( m_pWindow.get() )->SetMax( aMax );
+ static_cast< DateField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
+ static_cast< DateField* >( m_pWindow.get() )->EnableEmptyFieldValue( true );
+
+ static_cast< DateField* >( m_pPainter.get() )->SetExtDateFormat( (ExtDateFieldFormat)nFormat );
+ static_cast< DateField* >( m_pPainter.get() )->SetMin( aMin );
+ static_cast< DateField* >( m_pPainter.get() )->SetMax( aMax );
+ static_cast< DateField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
+ static_cast< DateField* >( m_pPainter.get() )->EnableEmptyFieldValue( true );
}
namespace
@@ -2288,27 +2288,27 @@ void DbTimeField::implAdjustGenericFieldSetting( const Reference< XPropertySet >
{
DBG_ASSERT( m_pWindow, "DbTimeField::implAdjustGenericFieldSetting: not to be called without window!" );
DBG_ASSERT( _rxModel.is(), "DbTimeField::implAdjustGenericFieldSetting: invalid model!" );
- if ( m_pWindow && _rxModel.is() )
- {
- sal_Int16 nFormat = getINT16( _rxModel->getPropertyValue( FM_PROP_TIMEFORMAT ) );
- util::Time aMin;
- OSL_VERIFY( _rxModel->getPropertyValue( FM_PROP_TIMEMIN ) >>= aMin );
- util::Time aMax;
- OSL_VERIFY( _rxModel->getPropertyValue( FM_PROP_TIMEMAX ) >>= aMax );
- bool bStrict = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) );
+ if ( !m_pWindow || !_rxModel.is() )
+ return;
- static_cast< TimeField* >( m_pWindow.get() )->SetExtFormat( (ExtTimeFieldFormat)nFormat );
- static_cast< TimeField* >( m_pWindow.get() )->SetMin( aMin );
- static_cast< TimeField* >( m_pWindow.get() )->SetMax( aMax );
- static_cast< TimeField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
- static_cast< TimeField* >( m_pWindow.get() )->EnableEmptyFieldValue( true );
+ sal_Int16 nFormat = getINT16( _rxModel->getPropertyValue( FM_PROP_TIMEFORMAT ) );
+ util::Time aMin;
+ OSL_VERIFY( _rxModel->getPropertyValue( FM_PROP_TIMEMIN ) >>= aMin );
+ util::Time aMax;
+ OSL_VERIFY( _rxModel->getPropertyValue( FM_PROP_TIMEMAX ) >>= aMax );
+ bool bStrict = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) );
- static_cast< TimeField* >( m_pPainter.get() )->SetExtFormat( (ExtTimeFieldFormat)nFormat );
- static_cast< TimeField* >( m_pPainter.get() )->SetMin( aMin );
- static_cast< TimeField* >( m_pPainter.get() )->SetMax( aMax );
- static_cast< TimeField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
- static_cast< TimeField* >( m_pPainter.get() )->EnableEmptyFieldValue( true );
- }
+ static_cast< TimeField* >( m_pWindow.get() )->SetExtFormat( (ExtTimeFieldFormat)nFormat );
+ static_cast< TimeField* >( m_pWindow.get() )->SetMin( aMin );
+ static_cast< TimeField* >( m_pWindow.get() )->SetMax( aMax );
+ static_cast< TimeField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
+ static_cast< TimeField* >( m_pWindow.get() )->EnableEmptyFieldValue( true );
+
+ static_cast< TimeField* >( m_pPainter.get() )->SetExtFormat( (ExtTimeFieldFormat)nFormat );
+ static_cast< TimeField* >( m_pPainter.get() )->SetMin( aMin );
+ static_cast< TimeField* >( m_pPainter.get() )->SetMax( aMax );
+ static_cast< TimeField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
+ static_cast< TimeField* >( m_pPainter.get() )->EnableEmptyFieldValue( true );
}
namespace
@@ -2956,118 +2956,119 @@ void DbFilterField::SetText(const OUString& rText)
void DbFilterField::Update()
{
// should we fill the combobox with a filter proposal?
- if (m_bFilterList && !m_bFilterListFilled)
- {
- m_bFilterListFilled = true;
- Reference< css::beans::XPropertySet > xField = m_rColumn.GetField();
- if (!xField.is())
- return;
+ if (!m_bFilterList || m_bFilterListFilled)
+ return;
- OUString aName;
- xField->getPropertyValue(FM_PROP_NAME) >>= aName;
+ m_bFilterListFilled = true;
+ Reference< css::beans::XPropertySet > xField = m_rColumn.GetField();
+ if (!xField.is())
+ return;
- // the columnmodel
- Reference< css::container::XChild > xModelAsChild(m_rColumn.getModel(), UNO_QUERY);
- // the grid model
- xModelAsChild.set(xModelAsChild->getParent(),UNO_QUERY);
- Reference< XRowSet > xForm(xModelAsChild->getParent(), UNO_QUERY);
- if (!xForm.is())
- return;
+ OUString aName;
+ xField->getPropertyValue(FM_PROP_NAME) >>= aName;
- Reference<XPropertySet> xFormProp(xForm,UNO_QUERY);
- Reference< XTablesSupplier > xSupTab;
- xFormProp->getPropertyValue("SingleSelectQueryComposer") >>= xSupTab;
+ // the columnmodel
+ Reference< css::container::XChild > xModelAsChild(m_rColumn.getModel(), UNO_QUERY);
+ // the grid model
+ xModelAsChild.set(xModelAsChild->getParent(),UNO_QUERY);
+ Reference< XRowSet > xForm(xModelAsChild->getParent(), UNO_QUERY);
+ if (!xForm.is())
+ return;
- Reference< XConnection > xConnection(getConnection(xForm));
- if (!xSupTab.is())
- return;
+ Reference<XPropertySet> xFormProp(xForm,UNO_QUERY);
+ Reference< XTablesSupplier > xSupTab;
+ xFormProp->getPropertyValue("SingleSelectQueryComposer") >>= xSupTab;
- // search the field
- Reference< XColumnsSupplier > xSupCol(xSupTab,UNO_QUERY);
- Reference< css::container::XNameAccess > xFieldNames = xSupCol->getColumns();
- if (!xFieldNames->hasByName(aName))
- return;
+ Reference< XConnection > xConnection(getConnection(xForm));
+ if (!xSupTab.is())
+ return;
- Reference< css::container::XNameAccess > xTablesNames = xSupTab->getTables();
- Reference< css::beans::XPropertySet > xComposerFieldAsSet(xFieldNames->getByName(aName),UNO_QUERY);
+ // search the field
+ Reference< XColumnsSupplier > xSupCol(xSupTab,UNO_QUERY);
+ Reference< css::container::XNameAccess > xFieldNames = xSupCol->getColumns();
+ if (!xFieldNames->hasByName(aName))
+ return;
- if (xComposerFieldAsSet.is() && ::comphelper::hasProperty(FM_PROP_TABLENAME, xComposerFieldAsSet) &&
- ::comphelper::hasProperty(FM_PROP_FIELDSOURCE, xComposerFieldAsSet))
- {
- OUString aFieldName;
- OUString aTableName;
- xComposerFieldAsSet->getPropertyValue(FM_PROP_FIELDSOURCE) >>= aFieldName;
- xComposerFieldAsSet->getPropertyValue(FM_PROP_TABLENAME) >>= aTableName;
-
- // no possibility to create a select statement
- // looking for the complete table name
- if (!xTablesNames->hasByName(aTableName))
- return;
+ Reference< css::container::XNameAccess > xTablesNames = xSupTab->getTables();
+ Reference< css::beans::XPropertySet > xComposerFieldAsSet(xFieldNames->getByName(aName),UNO_QUERY);
- // build a statement and send as query;
- // Access to the connection
- Reference< XStatement > xStatement;
- Reference< XResultSet > xListCursor;
- Reference< css::sdb::XColumn > xDataField;
+ if (!xComposerFieldAsSet.is() ||
+ !::comphelper::hasProperty(FM_PROP_TABLENAME, xComposerFieldAsSet) ||
+ !::comphelper::hasProperty(FM_PROP_FIELDSOURCE, xComposerFieldAsSet))
+ return;
- try
- {
- Reference< XDatabaseMetaData > xMeta = xConnection->getMetaData();
+ OUString aFieldName;
+ OUString aTableName;
+ xComposerFieldAsSet->getPropertyValue(FM_PROP_FIELDSOURCE) >>= aFieldName;
+ xComposerFieldAsSet->getPropertyValue(FM_PROP_TABLENAME) >>= aTableName;
- OUString aQuote(xMeta->getIdentifierQuoteString());
- OUStringBuffer aStatement("SELECT DISTINCT ");
- aStatement.append(quoteName(aQuote, aName));
- if (!aFieldName.isEmpty() && aName != aFieldName)
- {
- aStatement.append(" AS ");
- aStatement.append(quoteName(aQuote, aFieldName));
- }
+ // no possibility to create a select statement
+ // looking for the complete table name
+ if (!xTablesNames->hasByName(aTableName))
+ return;
- aStatement.append(" FROM ");
+ // build a statement and send as query;
+ // Access to the connection
+ Reference< XStatement > xStatement;
+ Reference< XResultSet > xListCursor;
+ Reference< css::sdb::XColumn > xDataField;
- Reference< XPropertySet > xTableNameAccess(xTablesNames->getByName(aTableName), UNO_QUERY_THROW);
- aStatement.append(composeTableNameForSelect(xConnection, xTableNameAccess));
+ try
+ {
+ Reference< XDatabaseMetaData > xMeta = xConnection->getMetaData();
- xStatement = xConnection->createStatement();
- Reference< css::beans::XPropertySet > xStatementProps(xStatement, UNO_QUERY);
- xStatementProps->setPropertyValue(FM_PROP_ESCAPE_PROCESSING, makeAny(true));
+ OUString aQuote(xMeta->getIdentifierQuoteString());
+ OUStringBuffer aStatement("SELECT DISTINCT ");
+ aStatement.append(quoteName(aQuote, aName));
+ if (!aFieldName.isEmpty() && aName != aFieldName)
+ {
+ aStatement.append(" AS ");
+ aStatement.append(quoteName(aQuote, aFieldName));
+ }
- xListCursor = xStatement->executeQuery(aStatement.makeStringAndClear());
+ aStatement.append(" FROM ");
- Reference< css::sdbcx::XColumnsSupplier > xSupplyCols(xListCursor, UNO_QUERY);
- Reference< css::container::XIndexAccess > xFields(xSupplyCols->getColumns(), UNO_QUERY);
- xDataField.set(xFields->getByIndex(0), css::uno::UNO_QUERY);
- if (!xDataField.is())
- return;
- }
- catch(const Exception&)
- {
- ::comphelper::disposeComponent(xStatement);
- return;
- }
+ Reference< XPropertySet > xTableNameAccess(xTablesNames->getByName(aTableName), UNO_QUERY_THROW);
+ aStatement.append(composeTableNameForSelect(xConnection, xTableNameAccess));
- sal_Int16 i = 0;
- ::std::vector< OUString > aStringList;
- aStringList.reserve(16);
- OUString aStr;
- css::util::Date aNullDate = m_rColumn.GetParent().getNullDate();
- sal_Int32 nFormatKey = m_rColumn.GetKey();
- Reference< XNumberFormatter > xFormatter = m_rColumn.GetParent().getNumberFormatter();
- sal_Int16 nKeyType = ::comphelper::getNumberFormatType(xFormatter->getNumberFormatsSupplier()->getNumberFormats(), nFormatKey);
+ xStatement = xConnection->createStatement();
+ Reference< css::beans::XPropertySet > xStatementProps(xStatement, UNO_QUERY);
+ xStatementProps->setPropertyValue(FM_PROP_ESCAPE_PROCESSING, makeAny(true));
- while (!xListCursor->isAfterLast() && i++ < SHRT_MAX) // max number of entries
- {
- aStr = getFormattedValue(xDataField, xFormatter, aNullDate, nFormatKey, nKeyType);
- aStringList.push_back(aStr);
- (void)xListCursor->next();
- }
+ xListCursor = xStatement->executeQuery(aStatement.makeStringAndClear());
- // filling the entries for the combobox
- for (::std::vector< OUString >::const_iterator iter = aStringList.begin();
- iter != aStringList.end(); ++iter)
- static_cast<ComboBox*>(m_pWindow.get())->InsertEntry(*iter);
- }
+ Reference< css::sdbcx::XColumnsSupplier > xSupplyCols(xListCursor, UNO_QUERY);
+ Reference< css::container::XIndexAccess > xFields(xSupplyCols->getColumns(), UNO_QUERY);
+ xDataField.set(xFields->getByIndex(0), css::uno::UNO_QUERY);
+ if (!xDataField.is())
+ return;
+ }
+ catch(const Exception&)
+ {
+ ::comphelper::disposeComponent(xStatement);
+ return;
}
+
+ sal_Int16 i = 0;
+ ::std::vector< OUString > aStringList;
+ aStringList.reserve(16);
+ OUString aStr;
+ css::util::Date aNullDate = m_rColumn.GetParent().getNullDate();
+ sal_Int32 nFormatKey = m_rColumn.GetKey();
+ Reference< XNumberFormatter > xFormatter = m_rColumn.GetParent().getNumberFormatter();
+ sal_Int16 nKeyType = ::comphelper::getNumberFormatType(xFormatter->getNumberFormatsSupplier()->getNumberFormats(), nFormatKey);
+
+ while (!xListCursor->isAfterLast() && i++ < SHRT_MAX) // max number of entries
+ {
+ aStr = getFormattedValue(xDataField, xFormatter, aNullDate, nFormatKey, nKeyType);
+ aStringList.push_back(aStr);
+ (void)xListCursor->next();
+ }
+
+ // filling the entries for the combobox
+ for (::std::vector< OUString >::const_iterator iter = aStringList.begin();
+ iter != aStringList.end(); ++iter)
+ static_cast<ComboBox*>(m_pWindow.get())->InsertEntry(*iter);
}
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index e688ef251705..b99594b3ee33 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -2980,65 +2980,65 @@ void DbGridControl::Dispatch(sal_uInt16 nId)
void DbGridControl::Undo()
{
- if (!IsFilterMode() && IsValid(m_xCurrentRow) && IsModified())
- {
- // check if we have somebody doin' the UNDO for us
- int nState = -1;
- if (m_aMasterStateProvider.IsSet())
- nState = m_aMasterStateProvider.Call(DbGridControlNavigationBarState::Undo);
- if (nState>0)
- { // yes, we have, and the slot is enabled
- DBG_ASSERT(m_aMasterSlotExecutor.IsSet(), "DbGridControl::Undo : a state, but no execute link ?");
- bool lResult = m_aMasterSlotExecutor.Call(DbGridControlNavigationBarState::Undo);
- if (lResult)
- // handled
- return;
- }
- else if (nState == 0)
- // yes, we have, and the slot is disabled
+ if (IsFilterMode() || !IsValid(m_xCurrentRow) || !IsModified())
+ return;
+
+ // check if we have somebody doin' the UNDO for us
+ int nState = -1;
+ if (m_aMasterStateProvider.IsSet())
+ nState = m_aMasterStateProvider.Call(DbGridControlNavigationBarState::Undo);
+ if (nState>0)
+ { // yes, we have, and the slot is enabled
+ DBG_ASSERT(m_aMasterSlotExecutor.IsSet(), "DbGridControl::Undo : a state, but no execute link ?");
+ bool lResult = m_aMasterSlotExecutor.Call(DbGridControlNavigationBarState::Undo);
+ if (lResult)
+ // handled
return;
+ }
+ else if (nState == 0)
+ // yes, we have, and the slot is disabled
+ return;
- BeginCursorAction();
+ BeginCursorAction();
- bool bAppending = m_xCurrentRow->IsNew();
- bool bDirty = m_xCurrentRow->IsModified();
+ bool bAppending = m_xCurrentRow->IsNew();
+ bool bDirty = m_xCurrentRow->IsModified();
- try
- {
- // cancel editing
- Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*m_pDataCursor), UNO_QUERY);
- // no effects if we're not updating currently
- if (bAppending)
- // just refresh the row
- xUpdateCursor->moveToInsertRow();
- else
- xUpdateCursor->cancelRowUpdates();
+ try
+ {
+ // cancel editing
+ Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*m_pDataCursor), UNO_QUERY);
+ // no effects if we're not updating currently
+ if (bAppending)
+ // just refresh the row
+ xUpdateCursor->moveToInsertRow();
+ else
+ xUpdateCursor->cancelRowUpdates();
- }
- catch(Exception&)
- {
- DBG_UNHANDLED_EXCEPTION();
- }
+ }
+ catch(Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
- EndCursorAction();
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list