Tag: cws_src680_oj14
User: oj      
Date: 2007-05-24 10:47:03+0000
Modified:
   dba/reportdesign/inc/RptResId.hrc
   dba/reportdesign/source/ui/dlg/CondFormat.cxx
   dba/reportdesign/source/ui/dlg/dlgpage.cxx
   dba/reportdesign/source/ui/dlg/dlgpage.src
   dba/reportdesign/source/ui/inc/dlgedfunc.hxx
   dba/reportdesign/source/ui/misc/UITools.cxx
   dba/reportdesign/source/ui/report/DesignView.cxx
   dba/reportdesign/source/ui/report/ViewsWindow.cxx
   dba/reportdesign/uiconfig/dbreport/toolbar/sectionalignmentbar.xml

Log:
 #i77421# add alignment in char dialog

File Changes:

Directory: /dba/reportdesign/inc/
=================================

File [changed]: RptResId.hrc
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/inc/RptResId.hrc?r1=1.1.2.3&r2=1.1.2.4
Delta lines:  +3 -2
-------------------
--- RptResId.hrc        2007-05-24 09:45:03+0000        1.1.2.3
+++ RptResId.hrc        2007-05-24 10:47:00+0000        1.1.2.4
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: RptResId.hrc,v $
  *
- *  $Revision: 1.1.2.3 $
+ *  $Revision: 1.1.2.4 $
  *
- *  last change: $Author: lla $ $Date: 2007/05/24 09:45:03 $
+ *  last change: $Author: oj $ $Date: 2007/05/24 10:47:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -230,6 +230,7 @@
 #define RID_PAGE_TWOLN                                         ( 
RID_PAGE_START +  8 )
 #define RID_PAGEDIALOG_LINE                                    ( 
RID_PAGE_START +  9 )
 #define RID_PAGE_LINE                                          ( 
RID_PAGE_START + 10 )
+#define RID_PAGE_ALIGNMENT                                     ( 
RID_PAGE_START + 11 )
 
 // -----------------------------------------------------------------------
 #define RID_IMG_TREENODE_COLLAPSED                     ( RID_IMAGE_START +   1 
)

Directory: /dba/reportdesign/source/ui/dlg/
===========================================

File [changed]: CondFormat.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/dlg/CondFormat.cxx?r1=1.1.2.1&r2=1.1.2.2
Delta lines:  +3 -2
-------------------
--- CondFormat.cxx      2007-05-09 13:49:30+0000        1.1.2.1
+++ CondFormat.cxx      2007-05-24 10:47:00+0000        1.1.2.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: CondFormat.cxx,v $
  *
- *  $Revision: 1.1.2.1 $
+ *  $Revision: 1.1.2.2 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/09 13:49:30 $
+ *  last change: $Author: oj $ $Date: 2007/05/24 10:47:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -187,6 +187,7 @@
                 throw IllegalArgumentException();
 
             Reference< XFormatCondition > xCond = 
m_xCopy->createFormatCondition();
+            ::comphelper::copyProperties(m_xCopy.get(),xCond.get());
             m_xCopy->insertByIndex( _nNewCondIndex, makeAny( xCond ) );
 
             ConditionPtr pCon( new Condition( &m_aConditionPlayground, *this, 
m_rController ) );

File [changed]: dlgpage.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/dlg/dlgpage.cxx?r1=1.1.2.2&r2=1.1.2.3
Delta lines:  +4 -2
-------------------
--- dlgpage.cxx 2007-05-15 07:15:55+0000        1.1.2.2
+++ dlgpage.cxx 2007-05-24 10:47:00+0000        1.1.2.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dlgpage.cxx,v $
  *
- *  $Revision: 1.1.2.2 $
+ *  $Revision: 1.1.2.3 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/15 07:15:55 $
+ *  last change: $Author: oj $ $Date: 2007/05/24 10:47:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -90,6 +90,8 @@
                        AddTabPage(RID_PAGE_POSITION, 
pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), 0 ); 
                        AddTabPage(RID_PAGE_TWOLN, 
pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), 0 ); 
                        AddTabPage(RID_PAGE_BACKGROUND, 
pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
+            AddTabPage(RID_PAGE_ALIGNMENT, pFact->GetTabPageCreatorFunc( 
RID_SVXPAGE_ALIGNMENT ), 0 );
+            
                        break;
         case RID_PAGEDIALOG_LINE:
                        AddTabPage( 
RID_SVXPAGE_LINE,pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINE ), 0 );

File [changed]: dlgpage.src
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/dlg/dlgpage.src?r1=1.1.2.2&r2=1.1.2.3
Delta lines:  +11 -3
--------------------
--- dlgpage.src 2007-05-15 07:15:55+0000        1.1.2.2
+++ dlgpage.src 2007-05-24 10:47:00+0000        1.1.2.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dlgpage.src,v $
  *
- *  $Revision: 1.1.2.2 $
+ *  $Revision: 1.1.2.3 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/15 07:15:55 $
+ *  last change: $Author: oj $ $Date: 2007/05/24 10:47:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -211,6 +211,14 @@
                                PageResID = RID_PAGE_BACKGROUND ;
                                Text [ x-comment ] = " ";
                        };
+            PageItem
+                       {
+                               Identifier = RID_PAGE_ALIGNMENT ;
+                               Text [ de ] = "Ausrichtung" ;
+                   Text [ en-US ] = "Alignment" ;
+                               PageResID = RID_PAGE_ALIGNMENT ;
+                               Text [ x-comment ] = " ";
+                       };
                };
        };
        OKButton 1

Directory: /dba/reportdesign/source/ui/inc/
===========================================

File [changed]: dlgedfunc.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/dlgedfunc.hxx?r1=1.1.2.2&r2=1.1.2.3
Delta lines:  +1 -0
-------------------
--- dlgedfunc.hxx       2007-05-21 10:01:44+0000        1.1.2.2
+++ dlgedfunc.hxx       2007-05-24 10:47:00+0000        1.1.2.3
@@ -6,9 +6,9 @@
  *
  *  $RCSfile: dlgedfunc.hxx,v $
  *
- *  $Revision: 1.1.2.2 $
+ *  $Revision: 1.1.2.3 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/21 10:01:44 $
+ *  last change: $Author: oj $ $Date: 2007/05/24 10:47:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -132,6 +132,7 @@
        virtual BOOL MouseButtonUp( const MouseEvent& rMEvt );
        virtual BOOL MouseMove( const MouseEvent& rMEvt );
 
+    void SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL 
bQuickDrag);
 };
 
 }

Directory: /dba/reportdesign/source/ui/misc/
============================================

File [changed]: UITools.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/misc/UITools.cxx?r1=1.1.2.6&r2=1.1.2.7
Delta lines:  +133 -6
---------------------
--- UITools.cxx 2007-05-21 10:15:19+0000        1.1.2.6
+++ UITools.cxx 2007-05-24 10:47:00+0000        1.1.2.7
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: UITools.cxx,v $
  *
- *  $Revision: 1.1.2.6 $
+ *  $Revision: 1.1.2.7 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/21 10:15:19 $
+ *  last change: $Author: oj $ $Date: 2007/05/24 10:47:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -61,8 +61,14 @@
 #define ITEMID_CHARHIDDEN       33
 #define ITEMID_CHARSCALE_W      34
 #define ITEMID_BRUSH            35
+#define ITEMID_HORJUSTIFY       36
+#define ITEMID_VERJUSTIFY              37
+//#define ITEMID_IDENT                 38
+//#define ITEMID_DEGREES               39
 //#define ITEMID_CHARROTATE            SID_ATTR_CHAR_ROTATED
+
 #include <svx/charscaleitem.hxx>
+#include <svx/algitem.hxx>
 #include <svx/svdpagv.hxx>
 #ifndef RPTUI_TOOLS_HXX
 #include "UITools.hxx"
@@ -131,6 +137,8 @@
 #ifndef _COM_SUN_STAR_REPORT_XGROUPS_HPP_
 #include <com/sun/star/report/XGroups.hpp>
 #endif
+#include <com/sun/star/awt/TextAlign.hpp>
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
 #include <i18npool/mslangid.hxx>
 #ifndef RPTUI_DLGPAGE_HXX
 #include "dlgpage.hxx"
@@ -156,6 +164,101 @@
 {
 using namespace ::com::sun::star;
 // 
-----------------------------------------------------------------------------
+SvxCellHorJustify lcl_MapHorizontalAlignment(const sal_Int16 _nAlign)
+{
+    SvxCellHorJustify eRet = SVX_HOR_JUSTIFY_STANDARD;
+    switch(_nAlign)
+    {
+        case awt::TextAlign::LEFT:
+            eRet = SVX_HOR_JUSTIFY_LEFT;
+            break;
+        case awt::TextAlign::CENTER:
+            eRet = SVX_HOR_JUSTIFY_CENTER;
+            break;
+        case awt::TextAlign::RIGHT:
+            eRet = SVX_HOR_JUSTIFY_RIGHT;
+            break;
+        default:
+            OSL_ENSURE(0,"Illegal text alignment value!");
+            break;
+    }
+    return eRet;
+}
+// 
-----------------------------------------------------------------------------
+sal_Int16 lcl_MapHorizontalAlignment(const SvxCellHorJustify _eAlign)
+{
+    sal_Int16 nRet = awt::TextAlign::LEFT;
+    switch(_eAlign)
+    {
+        case SVX_HOR_JUSTIFY_LEFT:
+            nRet = awt::TextAlign::LEFT;
+            break;
+        case SVX_HOR_JUSTIFY_CENTER:
+            nRet = awt::TextAlign::CENTER;
+            break;
+        case SVX_HOR_JUSTIFY_RIGHT:
+            nRet = awt::TextAlign::RIGHT;
+            break;
+        case SVX_HOR_JUSTIFY_BLOCK:
+        case SVX_HOR_JUSTIFY_REPEAT:
+            nRet = awt::TextAlign::CENTER;
+            break;
+        default:
+            OSL_ENSURE(0,"Illegal text alignment value!");
+            break;
+    }
+    return nRet;
+}
+// 
-----------------------------------------------------------------------------
+SvxCellVerJustify lcl_MapVerticalAlignment(const sal_Int16 _nAlign)
+{
+    SvxCellVerJustify eRet = SVX_VER_JUSTIFY_STANDARD;
+    switch(_nAlign)
+    {
+        case text::ParagraphVertAlign::AUTOMATIC:
+        case text::ParagraphVertAlign::BASELINE:
+            eRet = SVX_VER_JUSTIFY_STANDARD;
+            break;
+        case text::ParagraphVertAlign::TOP:
+            eRet = SVX_VER_JUSTIFY_TOP;
+            break;
+        case text::ParagraphVertAlign::CENTER:
+            eRet = SVX_VER_JUSTIFY_CENTER;
+            break;
+        case text::ParagraphVertAlign::BOTTOM:
+            eRet = SVX_VER_JUSTIFY_BOTTOM;
+            break;
+        default:
+            OSL_ENSURE(0,"Illegal text alignment value!");
+            break;
+    }
+    return eRet;
+}
+// 
-----------------------------------------------------------------------------
+sal_Int16 lcl_MapVerticalAlignment(const SvxCellVerJustify _eAlign)
+{
+    sal_Int16 nRet = text::ParagraphVertAlign::TOP;
+    switch(_eAlign)
+    {
+        case SVX_VER_JUSTIFY_STANDARD:
+            nRet = text::ParagraphVertAlign::AUTOMATIC;
+            break;
+        case SVX_VER_JUSTIFY_TOP:
+            nRet = text::ParagraphVertAlign::TOP;
+            break;
+        case SVX_VER_JUSTIFY_CENTER:
+            nRet = text::ParagraphVertAlign::CENTER;
+            break;
+        case SVX_VER_JUSTIFY_BOTTOM:
+            nRet = text::ParagraphVertAlign::BOTTOM;
+            break;
+        default:
+            OSL_ENSURE(0,"Illegal text alignment value!");
+            break;
+    }
+    return nRet;
+}
+// 
-----------------------------------------------------------------------------
 sal_Int32 getGroupPosition(const uno::Reference< report::XReportDefinition >& 
_xReportDefinition,const uno::Reference< report::XGroup >& _xGroup)
 {
        OSL_ENSURE(_xReportDefinition.is(),"No report definition -> GPF!");
@@ -240,7 +343,11 @@
                { SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE },
                { SID_ATTR_CHAR_HIDDEN, SFX_ITEM_POOLABLE },
         { SID_ATTR_CHAR_SCALEWIDTH, SFX_ITEM_POOLABLE },
-        { SID_ATTR_BRUSH, SFX_ITEM_POOLABLE }
+        { SID_ATTR_BRUSH, SFX_ITEM_POOLABLE },
+        { SID_ATTR_ALIGN_HOR_JUSTIFY, SFX_ITEM_POOLABLE },
+        //{ SID_ATTR_ALIGN_INDENT, SFX_ITEM_POOLABLE },
+        { SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE }
+        //{ SID_ATTR_ALIGN_DEGREES, SFX_ITEM_POOLABLE }
        };
     Window* pParent = VCLUnoHelper::GetWindow(_xWindow);
        ::std::auto_ptr<FontList> pFontList(new FontList( pParent ));
@@ -272,7 +379,11 @@
                new SvxCharReliefItem(),
                new SvxCharHiddenItem(),
         new SvxCharScaleWidthItem(),
-        new SvxBrushItem()
+        new SvxBrushItem(),
+        new SvxHorJustifyItem(),
+        //new SfxInt32Item(ITEMID_IDENT),
+        new SvxVerJustifyItem()
+        //new SfxInt32Item(ITEMID_DEGREES)
        };
 
        static USHORT pRanges[] =
@@ -291,13 +402,13 @@
                SID_ATTR_CHAR_CTL_FONT, 
                SID_ATTR_CHAR_CTL_WEIGHT
                */
-               ITEMID_FONT,ITEMID_BRUSH
+               ITEMID_FONT,ITEMID_VERJUSTIFY
        };
 
     bool bRet = false;
        try
        {
-               ::std::auto_ptr<SfxItemPool> pPool( new 
SfxItemPool(String::CreateFromAscii("ReportCharProperties"), 
ITEMID_FONT,ITEMID_BRUSH, aItemInfos, pDefaults) );
+               ::std::auto_ptr<SfxItemPool> pPool( new 
SfxItemPool(String::CreateFromAscii("ReportCharProperties"), 
ITEMID_FONT,ITEMID_VERJUSTIFY, aItemInfos, pDefaults) );
                // not needed for font height pPool->SetDefaultMetric( 
SFX_MAPUNIT_100TH_MM );  // ripped, don't understand why
                pPool->FreezeIdRanges();                                        
        // the same
 
@@ -333,6 +444,12 @@
                
pDescriptor->Put(SvxColorItem(::Color(_xReportControlFormat->getCharColor())));
         
pDescriptor->Put(SvxCharRotateItem(_xReportControlFormat->getCharRotation()));
         
pDescriptor->Put(SvxCharScaleWidthItem(_xReportControlFormat->getCharScaleWidth()));
+
+        
pDescriptor->Put(SvxHorJustifyItem(lcl_MapHorizontalAlignment(_xReportControlFormat->getParaAdjust())));
+        
//pDescriptor->Put(SfxInt32Item(ITEMID_DEGREES,_xReportControlFormat->getCharRotation()));
+        
pDescriptor->Put(SvxVerJustifyItem(lcl_MapVerticalAlignment(_xReportControlFormat->getParaVertAlignment())));
+        
//pDescriptor->Put(SfxInt32Item(ITEMID_IDENT,_xReportControlFormat->getCharRotation()));
+
         uno::Reference< report::XShape> 
xShape(_xReportControlFormat,uno::UNO_QUERY);
         if ( !xShape.is() )
             
pDescriptor->Put(SvxBrushItem(::Color(_xReportControlFormat->getControlBackground())));
@@ -490,6 +607,16 @@
                                        const SvxCharScaleWidthItem* pCharItem 
= static_cast<const SvxCharScaleWidthItem*>(pItem);
                     
aTempFont.SetWidthType(VCLUnoHelper::ConvertFontWidth(pCharItem->GetValue()));
                                }
+                if ( SFX_ITEM_SET == pSet->GetItemState( 
ITEMID_HORJUSTIFY,sal_True,&pItem) && pItem->ISA(SvxHorJustifyItem))
+                               {
+                                       const SvxHorJustifyItem* pJustifyItem = 
static_cast<const SvxHorJustifyItem*>(pItem);
+                    
_xReportControlFormat->setParaAdjust(lcl_MapHorizontalAlignment(static_cast<SvxCellHorJustify>(pJustifyItem->GetEnumValue())));
+                               }
+                if ( SFX_ITEM_SET == pSet->GetItemState( 
ITEMID_VERJUSTIFY,sal_True,&pItem) && pItem->ISA(SvxVerJustifyItem))
+                               {
+                                       const SvxVerJustifyItem* pJustifyItem = 
static_cast<const SvxVerJustifyItem*>(pItem);
+                    
_xReportControlFormat->setParaVertAlignment(lcl_MapVerticalAlignment(static_cast<SvxCellVerJustify>(pJustifyItem->GetEnumValue())));
+                               }
                 
                 awt::FontDescriptor aAwtFont = 
VCLUnoHelper::CreateFontDescriptor(aTempFont);
                 ::rtl::OUString sTemp = aAwtFont.Name;

Directory: /dba/reportdesign/source/ui/report/
==============================================

File [changed]: DesignView.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/DesignView.cxx?r1=1.1.2.4&r2=1.1.2.5
Delta lines:  +11 -11
---------------------
--- DesignView.cxx      2007-05-21 10:03:16+0000        1.1.2.4
+++ DesignView.cxx      2007-05-24 10:47:01+0000        1.1.2.5
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: DesignView.cxx,v $
  *
- *  $Revision: 1.1.2.4 $
+ *  $Revision: 1.1.2.5 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/21 10:03:16 $
+ *  last change: $Author: oj $ $Date: 2007/05/24 10:47:01 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -426,15 +426,15 @@
 void ODesignView::GetFocus()
 {
        Window::GetFocus();
-    if ( m_pScrollWindow ) 
-    {
-        ::boost::shared_ptr<OReportSection> pSection = 
m_pScrollWindow->getMarkedSection();
-        if ( !pSection )
-            
setMarked(getController()->getReportDefinition()->getDetail(),sal_True);
-        pSection = m_pScrollWindow->getMarkedSection();
-        if ( pSection )
-                   pSection->GrabFocus();
-    }
+    //if ( m_pScrollWindow ) 
+    //{
+    //    ::boost::shared_ptr<OReportSection> pSection = 
m_pScrollWindow->getMarkedSection();
+    //    if ( !pSection )
+    //        
setMarked(getController()->getReportDefinition()->getDetail(),sal_True);
+    //    pSection = m_pScrollWindow->getMarkedSection();
+    //    if ( pSection )
+                 //  pSection->GrabFocus();
+    //}
 }
 // 
-----------------------------------------------------------------------------
 void ODesignView::ImplInitSettings()

File [changed]: ViewsWindow.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ViewsWindow.cxx?r1=1.1.2.4&r2=1.1.2.5
Delta lines:  +29 -9
--------------------
--- ViewsWindow.cxx     2007-05-21 11:35:11+0000        1.1.2.4
+++ ViewsWindow.cxx     2007-05-24 10:47:01+0000        1.1.2.5
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ViewsWindow.cxx,v $
  *
- *  $Revision: 1.1.2.4 $
+ *  $Revision: 1.1.2.5 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/21 11:35:11 $
+ *  last change: $Author: oj $ $Date: 2007/05/24 10:47:01 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -90,6 +90,7 @@
 
 #include "helpids.hrc"
 #include <svx/svdundo.hxx>
+#include <algorithm>
 
 namespace rptui
 {
@@ -833,9 +834,10 @@
 // 
-----------------------------------------------------------------------------
 struct RectangleLess : public ::std::binary_function< Rectangle, Rectangle, 
bool>
 {
-    enum CompareMode { POS_LEFT,POS_RIGHT,POS_UPPER,POS_DOWN };
+    enum CompareMode { 
POS_LEFT,POS_RIGHT,POS_UPPER,POS_DOWN,POS_CENTER_HORIZONTAL,POS_CENTER_VERTICAL 
};
     CompareMode m_eCompareMode;
-    RectangleLess(CompareMode _eCompareMode ) : m_eCompareMode(_eCompareMode){}
+    Point       m_aRefPoint;
+    RectangleLess(CompareMode _eCompareMode,const Point& _rRefPoint ) : 
m_eCompareMode(_eCompareMode),m_aRefPoint(_rRefPoint){}
     bool operator() (const Rectangle& lhs, const Rectangle& rhs) const 
     {
         switch(m_eCompareMode)
@@ -852,6 +854,12 @@
             case POS_DOWN:
                 return lhs.Bottom() >= rhs.Bottom();
                 break;
+            case POS_CENTER_HORIZONTAL:
+                return abs(m_aRefPoint.X() - lhs.Center().X()) < 
abs(m_aRefPoint.X() - rhs.Center().X());
+                break;
+            case POS_CENTER_VERTICAL:
+                return abs(lhs.Center().Y() - m_aRefPoint.Y()) < 
abs(rhs.Center().Y() - m_aRefPoint.Y());
+                break;
         }
         return false;
     }
@@ -945,6 +953,7 @@
     if ( _nControlModification == ControlModification::NONE )
         return;
 
+    Point aRefPoint;
     RectangleLess::CompareMode eCompareMode = RectangleLess::POS_LEFT;
     switch (_nControlModification) 
     {
@@ -952,9 +961,20 @@
                case ControlModification::BOTTOM: eCompareMode = 
RectangleLess::POS_DOWN; break;
         case ControlModification::LEFT  : eCompareMode = 
RectangleLess::POS_LEFT; break;
                case ControlModification::RIGHT : eCompareMode = 
RectangleLess::POS_RIGHT; break;
+        case ControlModification::CENTER_HORIZONTAL :
+        case ControlModification::CENTER_VERTICAL :
+            {
+                eCompareMode = (ControlModification::CENTER_VERTICAL == 
_nControlModification) ?  RectangleLess::POS_CENTER_VERTICAL :  
RectangleLess::POS_CENTER_HORIZONTAL; 
+                uno::Reference<report::XSection> xSection = 
m_aSections.begin()->first.first->getSection();
+                uno::Reference<report::XReportDefinition> xReportDefinition = 
xSection->getReportDefinition();
+                           aRefPoint = 
Rectangle(lcl_getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN),0,
+                                                                       
lcl_getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width  - 
lcl_getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN),
+                                                                       
xSection->getHeight()).Center();
+            }
+            break;
                default: break;
        }
-    RectangleLess aCompare(eCompareMode);
+    RectangleLess aCompare(eCompareMode,aRefPoint);
     TRectangleMap aSortRectangles(aCompare);
     collectRectangles(aSortRectangles,_bBoundRects);
     
@@ -997,10 +1017,6 @@
                     pValue = &nYMov;
                     bMove = false;
                     break;
-                               case ControlModification::LEFT  : 
-                    aGetFun  = 
::std::mem_fun<long&,Rectangle>(&Rectangle::Left);
-                    aRefFun  = 
::std::mem_fun<long&,Rectangle>(&Rectangle::Right);
-                    break;
                                case ControlModification::RIGHT : 
                     aGetFun  = 
::std::mem_fun<long&,Rectangle>(&Rectangle::Right);
                     aRefFun  = 
::std::mem_fun<long&,Rectangle>(&Rectangle::Left);
@@ -1009,6 +1025,10 @@
                     nXMov = aCenter.X() - aObjRect.Center().X();
                     bMove = false;
                     break;
+                case ControlModification::LEFT  : 
+                    aGetFun  = 
::std::mem_fun<long&,Rectangle>(&Rectangle::Left);
+                    aRefFun  = 
::std::mem_fun<long&,Rectangle>(&Rectangle::Right);
+                    break;
                 default:
                     bMove = false;
                     break;

Directory: /dba/reportdesign/uiconfig/dbreport/toolbar/
=======================================================

File [changed]: sectionalignmentbar.xml
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/uiconfig/dbreport/toolbar/sectionalignmentbar.xml?r1=1.1.2.2&r2=1.1.2.3
Delta lines:  +0 -2
-------------------
--- sectionalignmentbar.xml     2007-05-21 11:33:26+0000        1.1.2.2
+++ sectionalignmentbar.xml     2007-05-24 10:47:01+0000        1.1.2.3
@@ -2,10 +2,8 @@
 <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 
1.0//EN" "toolbar.dtd">
 <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; toolbar:id="toolbar">
  <toolbar:toolbaritem xlink:href=".uno:SectionAlignLeft" 
toolbar:helpid="helpid:10131" />
- <toolbar:toolbaritem xlink:href=".uno:SectionAlignCenter" 
toolbar:helpid="helpid:10132" />
  <toolbar:toolbaritem xlink:href=".uno:SectionAlignRight" 
toolbar:helpid="helpid:10133" />
  <toolbar:toolbarbreak/>
  <toolbar:toolbaritem xlink:href=".uno:SectionAlignTop" 
toolbar:helpid="helpid:10134" />
- <toolbar:toolbaritem xlink:href=".uno:SectionAlignMiddle" 
toolbar:helpid="helpid:10135" />
  <toolbar:toolbaritem xlink:href=".uno:SectionAlignBottom" 
toolbar:helpid="helpid:10136" />
 </toolbar:toolbar>
\ No newline at end of file




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to