accessibility/source/extended/textwindowaccessibility.cxx |    1 
 include/vcl/textdata.hxx                                  |    1 
 include/vcl/vclmedit.hxx                                  |    2 +
 starmath/inc/cursor.hxx                                   |   22 +++++++-------
 starmath/source/node.cxx                                  |   18 ++++++-----
 starmath/source/rtfexport.cxx                             |    1 
 starmath/source/view.cxx                                  |   11 +++----
 svl/source/filerec/filerec.cxx                            |    6 ++-
 svl/source/inc/poolio.hxx                                 |    3 +
 sw/source/ui/dbui/mmaddressblockpage.cxx                  |   13 +++++---
 vcl/source/control/edit.cxx                               |    6 +--
 vcl/source/edit/textview.cxx                              |   18 ++++++++++-
 vcl/source/edit/vclmedit.cxx                              |   18 +++++++++++
 13 files changed, 85 insertions(+), 35 deletions(-)

New commits:
commit 49cecd8b41cac29cc9642944eaae5b5f63a1bd46
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Feb 19 12:26:47 2014 +0000

    Related: fdo#74242 hook up a selection and caret change for multiline edits
    
    a) split the textengine selection changed broadcast into a text selection 
changed
    and text caret change event
    b) handle both in existing places that handled the text selection event
    c) listen for them in VclMultiLineEdit and translate to
    VCLEVENT_EDIT_SELECTIONCHANGED VCLEVENT_EDIT_CARETCHANGED events
    d) profit from the VCLEVENT_EDIT_SELECTIONCHANGED and
    VCLEVENT_EDIT_CARETCHANGED handling in
    accessibility/source/standard/vclxaccessibleedit.cxx for VCLXAccessibleEdits
    
    Change-Id: I09187e76ae4eb189ee9469e388374154087faf80

diff --git a/accessibility/source/extended/textwindowaccessibility.cxx 
b/accessibility/source/extended/textwindowaccessibility.cxx
index d13525d..a37effa 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -1659,6 +1659,7 @@ void Document::Notify(::SfxBroadcaster &, ::SfxHint const 
& rHint)
                 break;
             }
         case TEXT_HINT_VIEWSELECTIONCHANGED:
+        case TEXT_HINT_VIEWCARETCHANGED:
             {
                 ::osl::MutexGuard aInternalGuard(GetMutex());
                 if (!isAlive())
diff --git a/include/vcl/textdata.hxx b/include/vcl/textdata.hxx
index 925efff..d05f2f7 100644
--- a/include/vcl/textdata.hxx
+++ b/include/vcl/textdata.hxx
@@ -121,6 +121,7 @@ inline sal_Bool TextSelection::operator != ( const 
TextSelection& rSel ) const
 
 #define TEXT_HINT_VIEWSCROLLED          100
 #define TEXT_HINT_VIEWSELECTIONCHANGED  101
+#define TEXT_HINT_VIEWCARETCHANGED      102
 
 class VCL_DLLPUBLIC TextHint : public SfxSimpleHint
 {
diff --git a/include/vcl/vclmedit.hxx b/include/vcl/vclmedit.hxx
index 83c50c6..097d9e8 100644
--- a/include/vcl/vclmedit.hxx
+++ b/include/vcl/vclmedit.hxx
@@ -63,6 +63,8 @@ public:
                     virtual ~VclMultiLineEdit();
 
 
+    void            SelectionChanged();
+    void            CaretChanged();
     virtual void    Modify();
     virtual void    UpdateData();
 
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx 
b/sw/source/ui/dbui/mmaddressblockpage.cxx
index bdb0848..18b9707 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1293,13 +1293,16 @@ AddressMultiLineEdit::~AddressMultiLineEdit()
     EndListening(*GetTextEngine());
 }
 
-void    AddressMultiLineEdit::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& 
rHint )
+void AddressMultiLineEdit::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& 
rHint)
 {
-    if(rHint.ISA(TextHint) &&
-            static_cast<const TextHint&>(rHint).GetId() == 
TEXT_HINT_VIEWSELECTIONCHANGED &&
-            m_aSelectionLink.IsSet())
+    if (m_aSelectionLink.IsSet() && rHint.ISA(TextHint))
     {
-        m_aSelectionLink.Call(this);
+        const TextHint& rTextHint = static_cast<const TextHint&>(rHint);
+        if (rTextHint.GetId() == TEXT_HINT_VIEWSELECTIONCHANGED ||
+            rTextHint.GetId() == TEXT_HINT_VIEWCARETCHANGED)
+        {
+            m_aSelectionLink.Call(this);
+        }
     }
 }
 
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index f923c51..cd75e6b 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2642,13 +2642,13 @@ void Edit::ImplSetSelection( const Selection& 
rSelection, sal_Bool bPaint )
                     ImplInvalidateOrRepaint();
                 ImplShowCursor();
 
-                sal_Bool bCaret = sal_False, bSelection = sal_False;
+                bool bCaret = false, bSelection = false;
                 long nB=aNew.Max(), nA=aNew.Min(),oB=aTemp.Max(), 
oA=aTemp.Min();
                 long nGap = nB-nA, oGap = oB-oA;
                 if (nB != oB)
-                    bCaret = sal_True;
+                    bCaret = true;
                 if (nGap != 0 || oGap != 0)
-                    bSelection = sal_True;
+                    bSelection = true;
 
                 if (bSelection)
                 {
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index cd5a9b3..53d49cc 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -463,10 +463,24 @@ void TextView::ImpHighlight( const TextSelection& rSel )
 
 void TextView::ImpSetSelection( const TextSelection& rSelection )
 {
-    if ( rSelection != mpImpl->maSelection )
+    if (rSelection != mpImpl->maSelection)
     {
+        bool bCaret = false, bSelection = false;
+        const TextPaM &rEnd = rSelection.GetEnd();
+        const TextPaM &rOldEnd = mpImpl->maSelection.GetEnd();
+        bool bGap = rSelection.HasRange(), bOldGap = 
mpImpl->maSelection.HasRange();
+        if (rEnd != rOldEnd)
+            bCaret = true;
+        if (bGap || bOldGap)
+            bSelection = true;
+
         mpImpl->maSelection = rSelection;
-        mpImpl->mpTextEngine->Broadcast( TextHint( 
TEXT_HINT_VIEWSELECTIONCHANGED ) );
+
+        if (bSelection)
+            
mpImpl->mpTextEngine->Broadcast(TextHint(TEXT_HINT_VIEWSELECTIONCHANGED));
+
+        if (bCaret)
+            
mpImpl->mpTextEngine->Broadcast(TextHint(TEXT_HINT_VIEWCARETCHANGED));
     }
 }
 
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index c468468..ca5e548 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -561,6 +561,14 @@ void ImpVclMEdit::Notify( SfxBroadcaster&, const SfxHint& 
rHint )
             ImpUpdateSrollBarVis(pVclMultiLineEdit->GetStyle());
             pVclMultiLineEdit->Modify();
         }
+        else if( rTextHint.GetId() == TEXT_HINT_VIEWSELECTIONCHANGED )
+        {
+            pVclMultiLineEdit->SelectionChanged();
+        }
+        else if( rTextHint.GetId() == TEXT_HINT_VIEWCARETCHANGED )
+        {
+            pVclMultiLineEdit->CaretChanged();
+        }
     }
 }
 
@@ -1053,6 +1061,16 @@ void VclMultiLineEdit::Modify()
         pUpdateDataTimer->Start();
 }
 
+void VclMultiLineEdit::SelectionChanged()
+{
+    CallEventListeners(VCLEVENT_EDIT_SELECTIONCHANGED);
+}
+
+void VclMultiLineEdit::CaretChanged()
+{
+    CallEventListeners(VCLEVENT_EDIT_CARETCHANGED);
+}
+
 IMPL_LINK_NOARG(VclMultiLineEdit, ImpUpdateDataHdl)
 {
     UpdateData();
commit e77819f578b4b01314359380e6f115bacb9967f5
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Feb 19 15:18:55 2014 +0000

    coverity#738849 Uninitialized scalar field
    
    Change-Id: I5374e4427f800c4500818b97bfe6e94b303a8974

diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 8cc88a5..b1f6e8b 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -75,20 +75,22 @@ class SmDocShell;
  */
 class SmCursor{
 public:
-    SmCursor(SmNode* tree, SmDocShell* pShell){
-        //Initialize members
-        pTree           = tree;
-        anchor          = NULL;
-        position        = NULL;
-        pGraph          = NULL;
-        pDocShell       = pShell;
-        pClipboard      = NULL;
-        nEditSections   = 0;
+    SmCursor(SmNode* tree, SmDocShell* pShell)
+        : anchor(NULL)
+        , position(NULL)
+        , pTree(tree)
+        , pDocShell(pShell)
+        , pGraph(NULL)
+        , pClipboard(NULL)
+        , nEditSections(0)
+        , bIsEnabledSetModifiedSmDocShell(false)
+    {
         //Build graph
         BuildGraph();
     }
 
-    ~SmCursor(){
+    ~SmCursor()
+    {
         SetClipboard();
         delete pGraph;
         pGraph = NULL;
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 0e7d6a4..7bc5932 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2336,13 +2336,14 @@ void SmRectangleNode::Arrange(const OutputDevice &rDev, 
const SmFormat &/*rForma
 /**************************************************************************/
 
 
-SmTextNode::SmTextNode( SmNodeType eNodeType, const SmToken &rNodeToken, 
sal_uInt16 nFontDescP ) :
-    SmVisibleNode(eNodeType, rNodeToken)
+SmTextNode::SmTextNode( SmNodeType eNodeType, const SmToken &rNodeToken, 
sal_uInt16 nFontDescP )
+    : SmVisibleNode(eNodeType, rNodeToken)
+    , nFontDesc(nFontDescP)
+    , nSelectionStart(0)
+    , nSelectionEnd(0)
 {
-    nFontDesc = nFontDescP;
 }
 
-
 SmTextNode::SmTextNode( const SmToken &rNodeToken, sal_uInt16 nFontDescP )
     : SmVisibleNode(NTEXT, rNodeToken)
     , nFontDesc(nFontDescP)
@@ -2351,7 +2352,6 @@ SmTextNode::SmTextNode( const SmToken &rNodeToken, 
sal_uInt16 nFontDescP )
 {
 }
 
-
 void SmTextNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
 {
     SmNode::Prepare(rFormat, rDocShell);
commit bfd0e9b7eaa3d24de239647aba7374529dd67572
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Feb 19 15:17:22 2014 +0000

    coverity#738850 Uninitialized scalar field
    
    Change-Id: I87cd5cee9df31d2ff847d4c41978ae2b422bb71d

diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 6ffd0fb..0e7d6a4 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2343,10 +2343,12 @@ SmTextNode::SmTextNode( SmNodeType eNodeType, const 
SmToken &rNodeToken, sal_uIn
 }
 
 
-SmTextNode::SmTextNode( const SmToken &rNodeToken, sal_uInt16 nFontDescP ) :
-    SmVisibleNode(NTEXT, rNodeToken)
+SmTextNode::SmTextNode( const SmToken &rNodeToken, sal_uInt16 nFontDescP )
+    : SmVisibleNode(NTEXT, rNodeToken)
+    , nFontDesc(nFontDescP)
+    , nSelectionStart(0)
+    , nSelectionEnd(0)
 {
-    nFontDesc = nFontDescP;
 }
 
 
commit f37a8c6b8b16666a5fcf9689486a0e549e292aea
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Feb 19 15:14:11 2014 +0000

    coverity#738851 Uninitialized scalar field
    
    Change-Id: I1aa25c29c4e58b30d0fc29768af7c2025e39c1be

diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx
index 45354fc..bc121f5 100644
--- a/starmath/source/rtfexport.cxx
+++ b/starmath/source/rtfexport.cxx
@@ -17,6 +17,7 @@
 SmRtfExport::SmRtfExport(const SmNode* pIn)
     : SmWordExportBase(pIn)
     , m_pBuffer(0)
+    , m_nEncoding(RTL_TEXTENCODING_DONTKNOW)
 {
 }
 
commit 1ba089104be0be09e82b91102fc4543d15e33b0d
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Feb 19 15:11:15 2014 +0000

    coverity#738852 Uninitialized scalar field
    
    Change-Id: I03519a9ff6d3bde489e005ebc3affdce02eab8e4

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 7b5e042..b2cb21b 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1990,11 +1990,12 @@ void SmViewShell::GetState(SfxItemSet &rSet)
 }
 
 
-SmViewShell::SmViewShell(SfxViewFrame *pFrame_, SfxViewShell *):
-    SfxViewShell(pFrame_, SFX_VIEW_HAS_PRINTOPTIONS | SFX_VIEW_CAN_PRINT),
-    pImpl( new SmViewShell_Impl ),
-    aGraphic(this),
-    aGraphicController(aGraphic, SID_GAPHIC_SM, pFrame_->GetBindings())
+SmViewShell::SmViewShell(SfxViewFrame *pFrame_, SfxViewShell *)
+    : SfxViewShell(pFrame_, SFX_VIEW_HAS_PRINTOPTIONS | SFX_VIEW_CAN_PRINT)
+    , pImpl(new SmViewShell_Impl)
+    , aGraphic(this)
+    , aGraphicController(aGraphic, SID_GAPHIC_SM, pFrame_->GetBindings())
+    , bPasteState(false)
     , bInsertIntoEditWindow(false)
 {
     SAL_INFO( "starmath", "SmViewShell::SmViewShell" );
commit 636d41d09adf9cd903fd2f4008da9519367a61ae
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Feb 19 15:07:42 2014 +0000

    coverity#738853 Uninitialized scalar field
    
    Change-Id: I01e72000f9e624b73351306e7d52c0ba18cbd8e1

diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx
index 20c9fa9..3a7b24b 100644
--- a/svl/source/filerec/filerec.cxx
+++ b/svl/source/filerec/filerec.cxx
@@ -360,8 +360,10 @@ SfxMultiFixRecordWriter::SfxMultiFixRecordWriter
     Interne Methode f"ur Subklassen.
 */
 
-:   SfxSingleRecordWriter( nRecordType, pStream, nContentTag, nContentVer ),
-    _nContentCount( 0 )
+    :  SfxSingleRecordWriter( nRecordType, pStream, nContentTag, nContentVer )
+    , _nContentStartPos(0)
+    , _nContentSize(0)
+    , _nContentCount(0)
 {
     // Platz f"ur eigenen Header
     pStream->SeekRel( + SFX_REC_HEADERSIZE_MULTI );
commit 249d901a89a917c99cbd99005f8348bfe15e3ce3
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Feb 19 15:06:07 2014 +0000

    coverity#738854 Uninitialized scalar field
    
    Change-Id: Iace6e3f93f05342d7b1652e8118be01a142b82cc

diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index 9bb29f9..de90d0b 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -98,6 +98,7 @@ struct SfxItemPool_Impl
         , mnStart(nStart)
         , mnEnd(nEnd)
         , mnFileFormatVersion(0)
+        , nVersion(0)
         , nLoadingVersion(0)
         , nInitRefCount(0)
         , nVerStart(0)
@@ -106,8 +107,10 @@ struct SfxItemPool_Impl
         , nStoringEnd(0)
         , nMajorVer(0)
         , nMinorVer(0)
+        , eDefMetric(SFX_MAPUNIT_CM)
         , bInSetItem(false)
         , bStreaming(false)
+        , mbPersistentRefCounts(false)
     {
         DBG_ASSERT(mnStart, "Start-Which-Id must be greater 0" );
         memset( ppPoolDefaults, 0, sizeof( SfxPoolItem* ) * (nEnd - nStart + 
1));
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to