sd/source/ui/func/fuparagr.cxx |    4 -
 sd/source/ui/view/drtxtob.cxx  |  134 +++++++++++++++++++++--------------------
 2 files changed, 73 insertions(+), 65 deletions(-)

New commits:
commit 27fc60874795849b43903f27076e9dcafb958c76
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue May 20 12:37:42 2014 +0100

    Related: fdo#78151 disable promote or demote outline levels in master view
    
    it doesn't make sense in master view to do that
    
    Change-Id: I838422f93131b8a92745a624738c5be3a7ed3459

diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 73852d0..ec24fc9 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -253,88 +253,96 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
                 bool bDisableRight    = true;
                 bool bDisableUp       = true;
                 bool bDisableDown     = true;
-                OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
 
-                if (mpView->ISA(OutlineView))
-                {
-                    pOLV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
-                        mpViewShell->GetActiveWindow());
-                }
+                //fdo#78151 it doesn't make sense to promote or demote outline 
levels in master view.
+                const DrawViewShell* pDrawViewShell = dynamic_cast< 
DrawViewShell* >(mpViewShell);
+                const bool bInMasterView = pDrawViewShell && 
pDrawViewShell->GetEditMode() == EM_MASTERPAGE;
 
-                bool bOutlineViewSh = mpViewShell->ISA(OutlineViewShell);
-
-                if (pOLV &&
-                    ( pOLV->GetOutliner()->GetMode() == 
OUTLINERMODE_OUTLINEOBJECT || bOutlineViewSh ) )
+                if (!bInMasterView)
                 {
-                    // Outliner at outline-mode
-                    ::Outliner* pOutl = pOLV->GetOutliner();
+                    OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
 
-                    std::vector<Paragraph*> aSelList;
-                    pOLV->CreateSelectionList(aSelList);
-                    Paragraph* pPara = aSelList.empty() ? NULL : 
*(aSelList.begin());
+                    if (mpView->ISA(OutlineView))
+                    {
+                        pOLV = 
static_cast<OutlineView*>(mpView)->GetViewByWindow(
+                            mpViewShell->GetActiveWindow());
+                    }
 
-                    // find out if we are a OutlineView
-                    bool bIsOutlineView(OUTLINERMODE_OUTLINEVIEW == 
pOLV->GetOutliner()->GetMode());
+                    bool bOutlineViewSh = mpViewShell->ISA(OutlineViewShell);
 
-                    // This is ONLY for OutlineViews
-                    if(bIsOutlineView)
+                    if (pOLV &&
+                        ( pOLV->GetOutliner()->GetMode() == 
OUTLINERMODE_OUTLINEOBJECT || bOutlineViewSh ) )
                     {
-                        // allow move up if position is 2 or greater OR it
-                        // is a title object (and thus depth==1)
-                        if(pOutl->GetAbsPos(pPara) > 1 || ( 
pOutl->HasParaFlag(pPara,PARAFLAG_ISPAGE) && pOutl->GetAbsPos(pPara) > 0 ) )
+                        // Outliner at outline-mode
+                        ::Outliner* pOutl = pOLV->GetOutliner();
+
+                        std::vector<Paragraph*> aSelList;
+                        pOLV->CreateSelectionList(aSelList);
+                        Paragraph* pPara = aSelList.empty() ? NULL : 
*(aSelList.begin());
+
+                        // find out if we are a OutlineView
+                        bool bIsOutlineView(OUTLINERMODE_OUTLINEVIEW == 
pOLV->GetOutliner()->GetMode());
+
+                        // This is ONLY for OutlineViews
+                        if(bIsOutlineView)
                         {
-                            // not at top
-                            bDisableUp = false;
+                            // allow move up if position is 2 or greater OR it
+                            // is a title object (and thus depth==1)
+                            if(pOutl->GetAbsPos(pPara) > 1 || ( 
pOutl->HasParaFlag(pPara,PARAFLAG_ISPAGE) && pOutl->GetAbsPos(pPara) > 0 ) )
+                            {
+                                // not at top
+                                bDisableUp = false;
+                            }
                         }
-                    }
-                    else
-                    {
-                        // old behaviour for OUTLINERMODE_OUTLINEOBJECT
-                        if(pOutl->GetAbsPos(pPara) > 0)
+                        else
                         {
-                            // not at top
-                            bDisableUp = false;
+                            // old behaviour for OUTLINERMODE_OUTLINEOBJECT
+                            if(pOutl->GetAbsPos(pPara) > 0)
+                            {
+                                // not at top
+                                bDisableUp = false;
+                            }
                         }
-                    }
 
-                    for (std::vector<Paragraph*>::const_iterator iter = 
aSelList.begin(); iter != aSelList.end(); ++iter)
-                    {
-                        pPara = *iter;
-
-                        sal_Int16 nDepth = pOutl->GetDepth( pOutl->GetAbsPos( 
pPara ) );
-
-                        if (nDepth > 0 || (bOutlineViewSh && (nDepth <= 0) && 
!pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE )) )
+                        for (std::vector<Paragraph*>::const_iterator iter = 
aSelList.begin(); iter != aSelList.end(); ++iter)
                         {
-                            // not minimum depth
-                            bDisableLeft = false;
+                            pPara = *iter;
+
+                            sal_Int16 nDepth = pOutl->GetDepth( 
pOutl->GetAbsPos( pPara ) );
+
+                            if (nDepth > 0 || (bOutlineViewSh && (nDepth <= 0) 
&& !pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE )) )
+                            {
+                                // not minimum depth
+                                bDisableLeft = false;
+                            }
+
+                            if( (nDepth < pOLV->GetOutliner()->GetMaxDepth() 
&& ( !bOutlineViewSh || pOutl->GetAbsPos(pPara) != 0 )) ||
+                                (bOutlineViewSh && (nDepth <= 0) && 
pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) && pOutl->GetAbsPos(pPara) != 0) )
+                            {
+                                // not maximum depth and not at top
+                                bDisableRight = false;
+                            }
                         }
 
-                        if( (nDepth < pOLV->GetOutliner()->GetMaxDepth() && ( 
!bOutlineViewSh || pOutl->GetAbsPos(pPara) != 0 )) ||
-                            (bOutlineViewSh && (nDepth <= 0) && 
pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) && pOutl->GetAbsPos(pPara) != 0) )
+                        if ( ( pOutl->GetAbsPos(pPara) < 
pOutl->GetParagraphCount() - 1 ) &&
+                             ( pOutl->GetParagraphCount() > 1 || 
!bOutlineViewSh) )
                         {
-                            // not maximum depth and not at top
-                            bDisableRight = false;
+                            // not last paragraph
+                            bDisableDown = false;
                         }
-                    }
 
-                    if ( ( pOutl->GetAbsPos(pPara) < 
pOutl->GetParagraphCount() - 1 ) &&
-                         ( pOutl->GetParagraphCount() > 1 || !bOutlineViewSh) )
-                    {
-                        // not last paragraph
-                        bDisableDown = false;
-                    }
-
-                    // disable when first para and 2nd is not a title
-                    pPara = aSelList.empty() ? NULL : *(aSelList.begin());
+                        // disable when first para and 2nd is not a title
+                        pPara = aSelList.empty() ? NULL : *(aSelList.begin());
 
-                    if(!bDisableDown && bIsOutlineView
-                        && pPara
-                        && 0 == pOutl->GetAbsPos(pPara)
-                        && pOutl->GetParagraphCount() > 1
-                        && !pOutl->HasParaFlag( pOutl->GetParagraph(1), 
PARAFLAG_ISPAGE ) )
-                    {
-                        // Needs to be disabled
-                        bDisableDown = true;
+                        if(!bDisableDown && bIsOutlineView
+                            && pPara
+                            && 0 == pOutl->GetAbsPos(pPara)
+                            && pOutl->GetParagraphCount() > 1
+                            && !pOutl->HasParaFlag( pOutl->GetParagraph(1), 
PARAFLAG_ISPAGE ) )
+                        {
+                            // Needs to be disabled
+                            bDisableDown = true;
+                        }
                     }
                 }
 
commit 52871279e9811d437ebe881e30b6c76208c84e65
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue May 20 09:35:13 2014 +0100

    Related: fdo#78151 fix 'pIds unsorted' warning
    
    Change-Id: I00c533a25a851d8bf57f1b0758e98915d2291ee9

diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx
index edc1f61..de0dc0e 100644
--- a/sd/source/ui/func/fuparagr.cxx
+++ b/sd/source/ui/func/fuparagr.cxx
@@ -137,15 +137,15 @@ void FuParagraph::DoExecute( SfxRequest& rReq )
     // invalidate slots
     static sal_uInt16 SidArray[] = {
         SID_ATTR_TABSTOP,
-    SID_ATTR_PARA_LINESPACE,
-    SID_ATTR_PARA_ULSPACE,
         SID_ATTR_PARA_ADJUST_LEFT,
         SID_ATTR_PARA_ADJUST_RIGHT,
         SID_ATTR_PARA_ADJUST_CENTER,
         SID_ATTR_PARA_ADJUST_BLOCK,
+        SID_ATTR_PARA_LINESPACE,
         SID_ATTR_PARA_LINESPACE_10,
         SID_ATTR_PARA_LINESPACE_15,
         SID_ATTR_PARA_LINESPACE_20,
+        SID_ATTR_PARA_ULSPACE,
         SID_ATTR_PARA_LRSPACE,
         SID_ATTR_PARA_LEFT_TO_RIGHT,
         SID_ATTR_PARA_RIGHT_TO_LEFT,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to