[Libreoffice-commits] core.git: 5 commits - dictionaries editeng/source include/editeng sc/source svtools/source svx/source sw/qa sw/source xmloff/source

Zolnai Tamás zolnaitamas2000 at gmail.com
Sun Sep 15 10:07:44 PDT 2013


 dictionaries                         |    2 +-
 editeng/source/items/borderline.cxx  |    4 ++--
 editeng/source/items/frmitems.cxx    |    2 +-
 include/editeng/borderline.hxx       |    3 ---
 sc/source/core/data/attrib.cxx       |    4 ++--
 sc/source/ui/view/printfun.cxx       |    2 +-
 svtools/source/control/ctrlbox.cxx   |    4 ++--
 svx/source/table/tablelayouter.cxx   |    4 ++--
 sw/qa/extras/inc/swmodeltestbase.hxx |   10 ++++++++++
 sw/source/core/inc/frmtool.hxx       |   10 +++++++++-
 sw/source/core/inc/swfont.hxx        |   13 ++++++-------
 sw/source/core/text/inftxt.hxx       |    5 +++++
 sw/source/core/text/itrform2.cxx     |   30 +++++++++++++++++++-----------
 sw/source/filter/xml/xmlithlp.cxx    |    3 +--
 sw/source/ui/inc/chrdlgmodes.hxx     |    2 +-
 sw/source/ui/inc/uitool.hxx          |   24 +++++++++++++++++-------
 sw/source/ui/utlui/uitool.cxx        |    4 ++--
 xmloff/source/text/txtexppr.cxx      |    5 +++++
 xmloff/source/text/txtimppr.cxx      |    6 ++++++
 19 files changed, 92 insertions(+), 45 deletions(-)

New commits:
commit f356fd26a10112cc3c475b224d1b5f7486253ed2
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Mon Sep 9 15:13:31 2013 +0200

    CharBrd 10: Some documentation
    
    Change-Id: I4c6c2cd4acf8ae4a759a662f92066ad63df74b3c

diff --git a/dictionaries b/dictionaries
index b07ae33..a32a341 160000
--- a/dictionaries
+++ b/dictionaries
@@ -1 +1 @@
-Subproject commit b07ae33b0d25e33bf890fab8fbcd3317506bbeae
+Subproject commit a32a341efdbb9e53a7b832262a41f6fb6454bedf
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 353cd63..81a4aa2 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -359,6 +359,16 @@ protected:
     sal_uInt32 m_nStartTime;
 };
 
+/**
+ * Test whether the expected and actual borderline parameters are equal
+ * and assert if not.
+ *
+ * @param[in]   rExpected    expected borderline object
+ * @param[in]   rActual      actual borderline object
+ * @param[in]   rSourceLine  line from where the assertion is called
+ * Note: This method is the implementatition of CPPUNIT_ASSERT_BORDER_EQUAL, so
+ *       use that macro instead.
+**/
 inline void assertBorderEqual(
     const table::BorderLine2& rExpected, const table::BorderLine2& rActual,
     const CppUnit::SourceLine& rSourceLine )
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index b478f55..5519eb0 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -65,7 +65,15 @@ void SwAlignRect( SwRect &rRect, const ViewShell *pSh );
 // Created declaration here to avoid <extern> declarations
 void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
 
-// Paint character border using frame painting code
+/**
+ * Paint border around a run of characters using frame painting code.
+ *
+ * @param[in]   rFont            font object of actual text, which specify the border
+ * @param[in]   rPaintArea       rectangle area in which line portion takes place
+ * @param[in]   bVerticalLayout  corresponding text frame verticality
+ * @param[in]   bJoinWithPrev    leave border with which actual border joins to the previous portion
+ * @param[in]   bJoinWithNext    leave border with which actual border joins to the next portion
+**/
 void PaintCharacterBorder(
     const SwFont& rFont, const SwRect& rPaintArea, const bool bVerticalLayout,
     const bool bJoinWithPrev, const bool bJoinWithNext );
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 4b9821b..f347d20 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -370,7 +370,6 @@ public:
     inline void Invalidate()
         { bFntChg = bOrgChg = sal_True; }
 
-    // set/get borders
     void SetTopBorder( const editeng::SvxBorderLine* pTopBorder );
     void SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder );
     void SetRightBorder( const editeng::SvxBorderLine* pRightBorder );
@@ -381,7 +380,7 @@ public:
     const boost::optional<editeng::SvxBorderLine>& GetRightBorder() const { return m_aRightBorder; }
     const boost::optional<editeng::SvxBorderLine>& GetLeftBorder() const { return m_aLeftBorder; }
 
-    // Get borders which are at absolute positions
+    // Get absolute border correspond to the layout verticality and orientation.
     const boost::optional<editeng::SvxBorderLine>& GetAbsTopBorder( const bool bVertLayout ) const;
     const boost::optional<editeng::SvxBorderLine>& GetAbsBottomBorder( const bool bVertLayout ) const;
     const boost::optional<editeng::SvxBorderLine>& GetAbsRightBorder( const bool bVertLayout ) const;
@@ -397,22 +396,22 @@ public:
     sal_uInt16 GetRightBorderDist() const { return m_nRightBorderDist; }
     sal_uInt16 GetLeftBorderDist() const { return m_nLeftBorderDist; }
 
-    // Return with the border width plus spacing
+    // Return with the whole space which border holed (border width, spacing and shadow width)
     sal_uInt16 GetTopBorderSpace() const;
     sal_uInt16 GetBottomBorderSpace() const;
     sal_uInt16 GetRightBorderSpace() const;
     sal_uInt16 GetLeftBorderSpace() const;
 
+    /// Check whether font has any border on any side
     bool HasBorder() const;
 
-    // Shadow attributes
     void SetShadowColor( const Color& rColor );
     void SetShadowWidth( const sal_uInt16 nWidth );
     void SetShadowLocation( const SvxShadowLocation aLocation );
 
-    const Color& GetShadowColor() const { return m_aShadowColor; }
-    sal_uInt16 GetShadowWidth() const { return m_nShadowWidth; }
-    SvxShadowLocation GetShadowLocation() const { return m_aShadowLocation; }
+    const Color&        GetShadowColor() const { return m_aShadowColor; }
+    sal_uInt16          GetShadowWidth() const { return m_nShadowWidth; }
+    SvxShadowLocation   GetShadowLocation() const { return m_aShadowLocation; }
 
     /**
      * Get the absolute shadow location dependant from orientation.
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index df2ccc3..4fadf2a 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -443,6 +443,11 @@ public:
     void DrawViewOpt( const SwLinePortion &rPor, const MSHORT nWhich ) const;
     void DrawBackBrush( const SwLinePortion &rPor ) const;
 
+    /**
+     * Draw character border around a line portion.
+     *
+     * @param[in]   rPor    line portion around which border have to be drawn.
+    **/
     void DrawBorder( const SwLinePortion &rPor ) const;
 
     void DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const;
diff --git a/sw/source/ui/inc/chrdlgmodes.hxx b/sw/source/ui/inc/chrdlgmodes.hxx
index 4cbf007..d60ff0f 100644
--- a/sw/source/ui/inc/chrdlgmodes.hxx
+++ b/sw/source/ui/inc/chrdlgmodes.hxx
@@ -10,7 +10,7 @@
 #ifndef SW_CHAR_DLG_MODES_HXX
 #define SW_CHAR_DLG_MODES_HXX
 
-//DialogModes:
+// DialogModes for SwCharDlg
 #define DLG_CHAR_STD    0
 #define DLG_CHAR_DRAW   1
 #define DLG_CHAR_ENV    2
diff --git a/sw/source/ui/inc/uitool.hxx b/sw/source/ui/inc/uitool.hxx
index 85387a2..ecf1783 100644
--- a/sw/source/ui/inc/uitool.hxx
+++ b/sw/source/ui/inc/uitool.hxx
@@ -39,19 +39,29 @@ class SfxViewFrame;
 // switch a metric
 SW_DLLPUBLIC void SetMetric(MetricFormatter& rCtrl, FieldUnit eUnit);
 
-// fill BoxInfoAttribut
+// fill BoxInfo attribute
 SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
 
 // Modes for attribute conversion
 #define CONV_ATTR_STD    1  // Standard character dialog
 #define CONV_ATTR_ENV    2  // Character dialog opened from envelope dialog
 
-// Convert character specific attributes to general ones used by tab pages
-SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet& rSet, sal_uInt8 nMode);
-
-// Convert general attributes to the corresponding character attributes
-// This method is used after executed a character dialog
-SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet& rSet, sal_uInt8 nMode);
+/**
+ * Convert character specific attributes to general ones used by tab pages.
+ *
+ * @param[in|out]   rSet    the set in which character attributes are stored
+ * @param[in]       nMode   specify the dialog which will be called after conversion
+**/
+SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode);
+
+/**
+ * Convert general attributes to the corresponding character attributes.
+ * This method is used after executed a character dialog.
+ *
+ * @param[in|out]   rSet    the set in which character attributes are stored
+ * @param[in]       nMode   specify the dialog which was called before
+**/
+SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet& rSet, const sal_uInt8 nMode);
 
 // SfxItemSets <-> PageDesc
 void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx
index 455e738..5409b2f 100644
--- a/sw/source/ui/utlui/uitool.cxx
+++ b/sw/source/ui/utlui/uitool.cxx
@@ -119,7 +119,7 @@ void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh)
     rSet.Put(aBoxInfo);
 }
 
-void ConvertAttrCharToGen(SfxItemSet& rSet, sal_uInt8 nMode)
+void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode)
 {
     // Background
     {
@@ -159,7 +159,7 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, sal_uInt8 nMode)
     }
 }
 
-void ConvertAttrGenToChar(SfxItemSet& rSet, sal_uInt8 nMode)
+void ConvertAttrGenToChar(SfxItemSet& rSet, const sal_uInt8 nMode)
 {
     // Background
     {
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index 12a72a5..ec4e439 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -336,6 +336,11 @@ lcl_checkMultiProperty(XMLPropertyState *const pState,
     }
 }
 
+/**
+ * Filter context of paragraph and character borders.
+ * Compress border attriubtes. If one of groupable attributes (border type, border width, padding)
+ * is equal for all four side then just one general attribute will be exported.
+**/
 static void lcl_FilterBorders(
     XMLPropertyState* pAllBorderWidthState, XMLPropertyState* pLeftBorderWidthState,
     XMLPropertyState* pRightBorderWidthState, XMLPropertyState* pTopBorderWidthState,
diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx
index 1e7ec03..cff85ac 100644
--- a/xmloff/source/text/txtimppr.cxx
+++ b/xmloff/source/text/txtimppr.cxx
@@ -268,6 +268,12 @@ isNotDefaultRelSize(const XMLPropertyState* pRelState, const UniReference<XMLPro
     return true;
 }
 
+/**
+ * Separate compressed border attributes.
+ * During export, border attributes are compressed if there are equal to all four side.
+ * Since Writer hasn't the same compressed attributes, but has distinct ones for all
+ * four side, we have to duplicate the compressed attribute during import.
+**/
 static void lcl_SeparateBorder(
     sal_uInt16 nIndex, XMLPropertyState* pAllBorderDistance,
     XMLPropertyState* pBorderDistances[4], XMLPropertyState* pNewBorderDistances[4],
commit e37a33f5743ab8f3e31a919586842f6f8952d381
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Thu Sep 12 12:52:51 2013 +0200

    In some case character border merge is called twice
    
    Change-Id: I206b3a448b45c918070bb73074bea79e94231297

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 05d6854..0b9074f 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -2639,11 +2639,15 @@ void SwTxtFormatter::MergeCharacterBorder( SwLinePortion& rPortion, SwTxtFormatI
         // The current portion isn't inserted into the portion chain yet, so the info's
         // last portion will be the previous one
         if( rInf.GetLast() && rInf.GetLast() != &rPortion && // For para portion (special case)
-            rInf.GetLast()->GetJoinBorderWithNext())
+            rInf.GetLast()->GetJoinBorderWithNext() )
         {
-            rPortion.SetJoinBorderWithPrev(true);
-            if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetLeftBorderSpace() )
-                rPortion.Width(rPortion.Width() - aCurFont.GetLeftBorderSpace());
+            // In some case border merge is called twice to the portion
+            if( !rPortion.GetJoinBorderWithPrev() )
+            {
+                rPortion.SetJoinBorderWithPrev(true);
+                if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetLeftBorderSpace() )
+                    rPortion.Width(rPortion.Width() - aCurFont.GetLeftBorderSpace());
+            }
         }
         else
         {
@@ -2653,18 +2657,22 @@ void SwTxtFormatter::MergeCharacterBorder( SwLinePortion& rPortion, SwTxtFormatI
 
         // Get next portion's font
         bool bSeek = false;
-        if( !rInf.IsFull() // Last portion of the line (in case of line break)
-            && rInf.GetIdx() + rPortion.GetLen() != rInf.GetTxt().getLength() ) // Last portion of the paragraph
+        if( !rInf.IsFull() && // Not the last portion of the line (in case of line break)
+            rInf.GetIdx() + rPortion.GetLen() != rInf.GetTxt().getLength() ) // Not the last portion of the paragraph
             bSeek = Seek(rInf.GetIdx() + rPortion.GetLen());
 
-        // If next portion has the same font then merge
+        // If next portion has the same border then merge
         if( bSeek && GetFnt()->HasBorder() && ::lcl_HasSameBorder(aCurFont, *GetFnt()) )
         {
-            rPortion.SetJoinBorderWithNext(true);
-            if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetRightBorderSpace() )
-                rPortion.Width(rPortion.Width() - aCurFont.GetRightBorderSpace());
+            // In some case border merge is called twice to the portion
+            if( !rPortion.GetJoinBorderWithNext() )
+            {
+                rPortion.SetJoinBorderWithNext(true);
+                if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetRightBorderSpace() )
+                    rPortion.Width(rPortion.Width() - aCurFont.GetRightBorderSpace());
+            }
         }
-        // If this is the last portion of the merge group than make the real height merge
+        // If this is the last portion of the merge group then make the real height merge
         else
         {
             rPortion.SetJoinBorderWithNext(false);
commit 3da52a1f5783ee1fd6fe7f741920b0450305f1b6
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Wed Sep 11 16:48:40 2013 +0200

    Remove unused width members from BorderLine class
    
    Change-Id: Ibf86c21ab13a4dce4e43634b26dfe8b3cf9a5b72

diff --git a/include/editeng/borderline.hxx b/include/editeng/borderline.hxx
index fd91e16..66194d6 100644
--- a/include/editeng/borderline.hxx
+++ b/include/editeng/borderline.hxx
@@ -62,9 +62,6 @@ namespace editeng {
         long m_nDiv;
 
         SvxBorderStyle   m_nStyle;
-        sal_uInt16 nOutWidth;
-        sal_uInt16 nInWidth;
-        sal_uInt16 nDistance;
 
         bool             m_bUseLeftTop;
         Color            (*m_pColorOutFn)( Color );
commit 922e4ba2994c914a8b393723fbee28529abd8a6b
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Wed Sep 11 16:45:41 2013 +0200

    Use the shorter GetScaledWidth() method
    
    Change-Id: Id3ad483d3830310b8d13c86e407ff88d9a709464

diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index 6a61aad..e80685e 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -661,8 +661,8 @@ OUString SvxBorderLine::GetValueString( SfxMapUnit eSrcUnit,
 
 bool SvxBorderLine::HasPriority( const SvxBorderLine& rOtherLine ) const
 {
-    const sal_uInt16 nThisSize = GetOutWidth() + GetDistance() + GetInWidth();
-    const sal_uInt16 nOtherSize = rOtherLine.GetOutWidth() + rOtherLine.GetDistance() + rOtherLine.GetInWidth();
+    const sal_uInt16 nThisSize = GetScaledWidth();
+    const sal_uInt16 nOtherSize = rOtherLine.GetScaledWidth();
 
     if ( nThisSize > nOtherSize )
     {
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 0c5917d..0d194b1 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2461,7 +2461,7 @@ sal_uInt16 SvxBoxItem::CalcLineSpace( sal_uInt16 nLine, sal_Bool bIgnoreLine ) c
 
     if( pTmp )
     {
-        nDist = nDist + (sal_uInt16)(pTmp->GetOutWidth()) + (sal_uInt16)(pTmp->GetInWidth()) + (sal_uInt16)(pTmp->GetDistance());
+        nDist = nDist + pTmp->GetScaledWidth();
     }
     else if( !bIgnoreLine )
         nDist = 0;
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index ce572b9..2ec52ec 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -67,8 +67,8 @@ bool ScHasPriority( const ::editeng::SvxBorderLine* pThis, const ::editeng::SvxB
     if (!pOther)
         return true;
 
-    sal_uInt16 nThisSize = pThis->GetOutWidth() + pThis->GetDistance() + pThis->GetInWidth();
-    sal_uInt16 nOtherSize = pOther->GetOutWidth() + pOther->GetDistance() + pOther->GetInWidth();
+    sal_uInt16 nThisSize = pThis->GetScaledWidth();
+    sal_uInt16 nOtherSize = pOther->GetScaledWidth();
 
     if (nThisSize > nOtherSize)
         return true;
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 0a7cb32..388f08d 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -165,7 +165,7 @@ size_t ScPageRowEntry::CountVisible() const
 
 static long lcl_LineTotal(const ::editeng::SvxBorderLine* pLine)
 {
-    return pLine ? ( pLine->GetOutWidth() + pLine->GetInWidth() + pLine->GetDistance() ) : 0;
+    return pLine ? ( pLine->GetScaledWidth() ) : 0;
 }
 
 void ScPrintFunc::Construct( const ScPrintOptions* pOptions )
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 9ccbdfa..55ed2d2 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -901,8 +901,8 @@ bool TableLayouter::HasPriority( const SvxBorderLine* pThis, const SvxBorderLine
     if (!pOther || (pOther == &gEmptyBorder))
         return true;
 
-    sal_uInt16 nThisSize = pThis->GetOutWidth() + pThis->GetDistance() + pThis->GetInWidth();
-    sal_uInt16 nOtherSize = pOther->GetOutWidth() + pOther->GetDistance() + pOther->GetInWidth();
+    sal_uInt16 nThisSize = pThis->GetScaledWidth();
+    sal_uInt16 nOtherSize = pOther->GetScaledWidth();
 
     if (nThisSize > nOtherSize)
         return true;
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 10627af..259d2fe 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -204,8 +204,7 @@ bool sw_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
            else
            {
                if (!bHasWidth)
-                   nWidth = rpLine->GetInWidth() + rpLine->GetDistance() +
-                       rpLine->GetOutWidth();
+                   nWidth = rpLine->GetScaledWidth();
 
                rpLine->SetWidth( nWidth );
            }
commit 1ae3638dbf82239ab3e64cbbc8ab34394a3fa1e2
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Wed Sep 11 14:35:58 2013 +0200

    Fix drawing of fine dashed border type
    
    On the Borders tab in the preview block (called User-defined area
    in help) fine dashed border is drawn as solid line.
    The problem is that 1 pixel gap is too small and painting
    can hadnle it so I doubled the numbers to get the same rate and
    get the rigth visual result.
    
    Change-Id: Ide037fa3f4f90b304dc53f5f806c2acd2194ec0c

diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index cefcc03..8855dcd 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -625,8 +625,8 @@ namespace svtools
             case STYLE_FINE_DASHED:
                 if ( eUnit == MAP_PIXEL )
                 {
-                    aPattern.push_back( 4 );
-                    aPattern.push_back( 1 );
+                    aPattern.push_back( 8 );
+                    aPattern.push_back( 2 );
                 }
                 else if ( eUnit == MAP_TWIP )
                 {


More information about the Libreoffice-commits mailing list