[Libreoffice-commits] core.git: Branch 'feature/sw-delete-undo-rework' - sw/source

2017-08-31 Thread Rosemary Sebastian
 sw/source/core/doc/DocumentRedlineManager.cxx |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit deb8df2842f27e45ee26bef9fbecaf28002dc09b
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Thu Aug 31 16:08:58 2017 +0530

Fix grouping of the last letter in a word ...

... when deleting a redline insert in change-tracking mode.

Change-Id: I948a5270962372ea4eaca3b876c4d1b847279346

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 1a62a0b04c64..1e92b43b1301 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1189,11 +1189,6 @@ bool DocumentRedlineManager::AppendRedline( 
SwRangeRedline* pNewRedl, bool bCall
 switch( eCmpPos )
 {
 case SwComparePosition::Equal:
-bCompress = true;
-mpRedlineTable->DeleteAndDestroy( n );
-bDec = true;
-SAL_FALLTHROUGH;
-
 case SwComparePosition::Inside:
 if( bCallDelete )
 {
@@ -1222,6 +1217,12 @@ bool DocumentRedlineManager::AppendRedline( 
SwRangeRedline* pNewRedl, bool bCall
 pNewRedl = nullptr;
 if (eCmpPos == SwComparePosition::Inside)
 pRedl->MaybeNotifyModification();
+else
+{
+bCompress = true;
+mpRedlineTable->DeleteAndDestroy( n );
+bDec = true;
+}
 break;
 
 case SwComparePosition::Outside:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/sw-delete-undo-rework' - sw/source

2017-08-30 Thread Rosemary Sebastian
Rebased ref, commits from common ancestor:
commit 0d0c80e26b5fe2c2bf78be329a441f6dffadf72a
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Wed Aug 30 21:47:22 2017 +0530

Preserve cursor behaviour for selection deletes

Change-Id: Ie3768a589b4c44230b30c559525710c6ca8efd4c

diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 0e9681af5b6d..d4f8202989f0 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -210,7 +210,7 @@ SwUndoDelete::SwUndoDelete(
 }
 
 // Move now also the PaM. The SPoint is at the beginning of a SSelection.
-if( pEnd == rPam.GetPoint() && ( !bFullPara || pSttTextNd || pEndTextNd ) )
+if( pEnd == rPam.GetPoint() && ( !bFullPara || pSttTextNd || pEndTextNd ) 
&& !m_bRedlineDelete )
 rPam.Exchange();
 
 if( !pSttTextNd && !pEndTextNd )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/sw-delete-undo-rework' - sw/source

2017-08-30 Thread Rosemary Sebastian
Rebased ref, commits from common ancestor:
commit a40c8f138d5eb6218976c5440e6a8a2d3666ef78
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Wed Aug 30 21:47:22 2017 +0530

Preserve cursor behaviour for selection deletes

For more information, please have a look at the discussion here:
https://bugs.documentfoundation.org/show_bug.cgi?id=109272

Change-Id: Ie3768a589b4c44230b30c559525710c6ca8efd4c

diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 0e9681af5b6d..d4f8202989f0 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -210,7 +210,7 @@ SwUndoDelete::SwUndoDelete(
 }
 
 // Move now also the PaM. The SPoint is at the beginning of a SSelection.
-if( pEnd == rPam.GetPoint() && ( !bFullPara || pSttTextNd || pEndTextNd ) )
+if( pEnd == rPam.GetPoint() && ( !bFullPara || pSttTextNd || pEndTextNd ) 
&& !m_bRedlineDelete )
 rPam.Exchange();
 
 if( !pSttTextNd && !pEndTextNd )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/sw-delete-undo-rework' - sw/source

2017-08-30 Thread Rosemary Sebastian
 sw/source/core/undo/undel.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0bd48242a731a37eeb049d5d692153f5f522097f
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Wed Aug 30 21:47:22 2017 +0530

Preserve cursor behaviour for selection deletes

Change-Id: Ie3768a589b4c44230b30c559525710c6ca8efd4c

diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 0e9681af5b6d..d4f8202989f0 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -210,7 +210,7 @@ SwUndoDelete::SwUndoDelete(
 }
 
 // Move now also the PaM. The SPoint is at the beginning of a SSelection.
-if( pEnd == rPam.GetPoint() && ( !bFullPara || pSttTextNd || pEndTextNd ) )
+if( pEnd == rPam.GetPoint() && ( !bFullPara || pSttTextNd || pEndTextNd ) 
&& !m_bRedlineDelete )
 rPam.Exchange();
 
 if( !pSttTextNd && !pEndTextNd )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/sw-delete-undo-rework' - 2 commits - sw/source

2017-08-30 Thread Rosemary Sebastian
Rebased ref, commits from common ancestor:
commit 626dab43b49639d96d2e28821cb29975aafbfb2f
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Aug 14 16:25:03 2017 +0530

Do not continue grouping if the Track Changes mode has changed

Change-Id: I8331c11fd7ce3b7b464a57a5710e9f4ee0cfb4fb

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index fd5590cc89ee..dc7a6319f426 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3590,7 +3590,7 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa
 SwUndoDelete * const pUndoDel( dynamic_cast< SwUndoDelete* 
>( pLastUndo ) );
 if( pUndoDel )
 {
-bMerged = pUndoDel->CanGrouping( _rDoc, rPam );
+bMerged = pUndoDel->CanGrouping( _rDoc, rPam, 
bRedlineDelete );
 // if CanGrouping() returns true it's already merged
 }
 }
diff --git a/sw/source/core/inc/UndoDelete.hxx 
b/sw/source/core/inc/UndoDelete.hxx
index ac22b3217a1e..fc934aa702ad 100644
--- a/sw/source/core/inc/UndoDelete.hxx
+++ b/sw/source/core/inc/UndoDelete.hxx
@@ -88,7 +88,7 @@ public:
 */
 virtual SwRewriter GetRewriter() const override;
 
-bool CanGrouping( SwDoc*, const SwPaM& );
+bool CanGrouping( SwDoc*, const SwPaM&, bool bRedlineDelete = false );
 
 void SetTableDelLastNd()  { m_bTableDelLastNd = true; }
 
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 9e82c2541e88..0e9681af5b6d 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -444,8 +444,12 @@ bool SwUndoDelete::SaveContent( const SwPosition* pStt, 
const SwPosition* pEnd,
 return true;// move Nodes lying in between
 }
 
-bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
+bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam, bool 
bRedlineDelete )
 {
+// Make sure the Track Changes mode is the same
+if( m_bRedlineDelete != bRedlineDelete )
+return false;
+
 // Is Undo greater than one Node (that is Start and EndString)?
 if( !m_pSttStr || m_pSttStr->isEmpty() || m_pEndStr )
 return false;
commit 67263a70cb0e9cc581c316ef50e7703fc0c24c1d
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Jul 17 16:31:36 2017 +0530

tdf#109151: Enable grouping of undo actions for delete redlines

Change-Id: I74183e5df58d8d0c5e892182f545a5ff17eb7936

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index df6455ed33bc..fd5590cc89ee 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3552,54 +3552,59 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa
 OSL_ENSURE( m_rDoc.getIDocumentRedlineAccess().IsRedlineOn(), 
"DeleteAndJoinWithRedline: redline off" );
 
 {
-SwUndoRedlineDelete* pUndo = nullptr;
+SwUndo *const pLastUndo( m_rDoc.GetUndoManager().GetLastUndo() );
 RedlineFlags eOld = 
m_rDoc.getIDocumentRedlineAccess().GetRedlineFlags();
 m_rDoc.GetDocumentRedlineManager().checkRedlining( eOld );
 if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
 {
-
 /* please don't translate -- for cultural reasons this comment is 
protected
until the redline implementation is finally fixed some day */
 //JP 06.01.98: MUSS noch optimiert werden!!!
+
+m_rDoc.GetIDocumentUndoRedo().ClearRedo();
 m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags(
 RedlineFlags::On | RedlineFlags::ShowInsert | 
RedlineFlags::ShowDelete );
+bool bAppendUndo(true);
+bool bRedlineDelete(true);
 
-pUndo = new SwUndoRedlineDelete( rPam, SwUndoId::DELETE );
-const SwRewriter aRewriter = pUndo->GetRewriter();
-m_rDoc.GetIDocumentUndoRedo().StartUndo( SwUndoId::DELETE, 
 );
-m_rDoc.GetIDocumentUndoRedo().AppendUndo( pUndo );
-}
-
-if ( *rPam.GetPoint() != *rPam.GetMark() )
-m_rDoc.getIDocumentRedlineAccess().AppendRedline( new 
SwRangeRedline( nsRedlineType_t::REDLINE_DELETE, rPam ), true );
-m_rDoc.getIDocumentState().SetModified();
+const SwPosition* pStt = rPam.Start();
+const SwPosition* pEnd = rPam.End();
+const SwRedlineTable& rTable = 
rPam.GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
+for( SwRedlineTable::size_type n = 0; n < rTable.size(

[Libreoffice-commits] core.git: Branch 'feature/sw-delete-undo-rework' - 2 commits - sw/source

2017-08-14 Thread Rosemary Sebastian
Rebased ref, commits from common ancestor:
commit eccc5c200ae1c56f823038ca284068ada49adda5
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Aug 14 16:25:03 2017 +0530

Do not continue grouping if the Track Changes mode has changed

Change-Id: I8331c11fd7ce3b7b464a57a5710e9f4ee0cfb4fb

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 95842c89c49f..005a54e5a4fb 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3602,7 +3602,7 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa
 SwUndoDelete * const pUndoDel( dynamic_cast< SwUndoDelete* 
>( pLastUndo ) );
 if( pUndoDel )
 {
-bMerged = pUndoDel->CanGrouping( _rDoc, rPam );
+bMerged = pUndoDel->CanGrouping( _rDoc, rPam, 
bRedlineDelete );
 // if CanGrouping() returns true it's already merged
 }
 }
diff --git a/sw/source/core/inc/UndoDelete.hxx 
b/sw/source/core/inc/UndoDelete.hxx
index ac22b3217a1e..fc934aa702ad 100644
--- a/sw/source/core/inc/UndoDelete.hxx
+++ b/sw/source/core/inc/UndoDelete.hxx
@@ -88,7 +88,7 @@ public:
 */
 virtual SwRewriter GetRewriter() const override;
 
-bool CanGrouping( SwDoc*, const SwPaM& );
+bool CanGrouping( SwDoc*, const SwPaM&, bool bRedlineDelete = false );
 
 void SetTableDelLastNd()  { m_bTableDelLastNd = true; }
 
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 9e82c2541e88..0e9681af5b6d 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -444,8 +444,12 @@ bool SwUndoDelete::SaveContent( const SwPosition* pStt, 
const SwPosition* pEnd,
 return true;// move Nodes lying in between
 }
 
-bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
+bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam, bool 
bRedlineDelete )
 {
+// Make sure the Track Changes mode is the same
+if( m_bRedlineDelete != bRedlineDelete )
+return false;
+
 // Is Undo greater than one Node (that is Start and EndString)?
 if( !m_pSttStr || m_pSttStr->isEmpty() || m_pEndStr )
 return false;
commit b2fa5f3f5ee68a0aa2225d7b5aa80ccef2cb70ac
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Jul 17 16:31:36 2017 +0530

tdf#109151: Enable grouping of undo actions for delete redlines

Change-Id: I74183e5df58d8d0c5e892182f545a5ff17eb7936

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index df6455ed33bc..95842c89c49f 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3552,54 +3552,71 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa
 OSL_ENSURE( m_rDoc.getIDocumentRedlineAccess().IsRedlineOn(), 
"DeleteAndJoinWithRedline: redline off" );
 
 {
-SwUndoRedlineDelete* pUndo = nullptr;
+SwUndo *const pLastUndo( m_rDoc.GetUndoManager().GetLastUndo() );
 RedlineFlags eOld = 
m_rDoc.getIDocumentRedlineAccess().GetRedlineFlags();
 m_rDoc.GetDocumentRedlineManager().checkRedlining( eOld );
 if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
 {
-
 /* please don't translate -- for cultural reasons this comment is 
protected
until the redline implementation is finally fixed some day */
 //JP 06.01.98: MUSS noch optimiert werden!!!
+
+m_rDoc.GetIDocumentUndoRedo().ClearRedo();
 m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags(
 RedlineFlags::On | RedlineFlags::ShowInsert | 
RedlineFlags::ShowDelete );
+bool bAppendUndo(true);
+bool bRedlineDelete(true);
 
-pUndo = new SwUndoRedlineDelete( rPam, SwUndoId::DELETE );
-const SwRewriter aRewriter = pUndo->GetRewriter();
-m_rDoc.GetIDocumentUndoRedo().StartUndo( SwUndoId::DELETE, 
 );
-m_rDoc.GetIDocumentUndoRedo().AppendUndo( pUndo );
-}
-
-if ( *rPam.GetPoint() != *rPam.GetMark() )
-m_rDoc.getIDocumentRedlineAccess().AppendRedline( new 
SwRangeRedline( nsRedlineType_t::REDLINE_DELETE, rPam ), true );
-m_rDoc.getIDocumentState().SetModified();
+const SwPosition* pStt = rPam.Start();
+const SwPosition* pEnd = rPam.End();
+const SwRedlineTable& rTable = 
rPam.GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
+SwRedlineTable::size_type n = 0;
+/* Check whether the delete redline falls i

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - sw/qa

2017-08-14 Thread Rosemary Sebastian
Rebased ref, commits from common ancestor:
commit 99061131d39f110650312d2063312815aa186af5
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Aug 14 13:54:00 2017 +0530

Remove redline import tests for now

This commit should be reverted after change-tracking import is implemented

Change-Id: I9443bc6bba39556aa92706ee02d6fff547133de1

diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index bbebd6b24afc..bf2c823368da 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -304,15 +304,6 @@ DECLARE_ODFEXPORT_TEST(testOOoxmlEmbedded, 
"oooxml_embedded.sxw")
 CPPUNIT_ASSERT_EQUAL(sal_Int32(SOFFICE_FILEFORMAT_8), 
comphelper::OStorageHelper::GetXStorageFormat(xStorage4));
 }
 
-DECLARE_ODFEXPORT_TEST(testredlineTextFrame, "redlineTextFrame.odt")
-{
-//Note this is for a crash test
-//Counting the Number of Frames and checking with the expected count
-uno::Reference xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
-uno::Reference 
xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
-}
-
 DECLARE_ODFEXPORT_TEST(testFdo38244, "fdo38244.odt")
 {
 // See ooxmlexport's testFdo38244().
@@ -1109,44 +1100,6 @@ DECLARE_ODFEXPORT_TEST(testWhitespace, "whitespace.odt")
 CPPUNIT_ASSERT_EQUAL(OUString(" X"), xPortion->getString());
 CPPUNIT_ASSERT(!xPortions->hasMoreElements());
 
-xPara.set(getParagraphOrTable(17), uno::UNO_QUERY);
-xPortions.set(xPara->createEnumeration());
-xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty(xPortion, 
"TextPortionType"));
-CPPUNIT_ASSERT_EQUAL(OUString("X "), xPortion->getString());
-xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty(xPortion, 
"TextPortionType"));
-CPPUNIT_ASSERT(!getProperty(xPortion, "IsCollapsed"));
-xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty(xPortion, 
"TextPortionType"));
-CPPUNIT_ASSERT_EQUAL(OUString(" "), xPortion->getString());
-xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty(xPortion, 
"TextPortionType"));
-CPPUNIT_ASSERT(!getProperty(xPortion, "IsCollapsed"));
-xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty(xPortion, 
"TextPortionType"));
-CPPUNIT_ASSERT_EQUAL(OUString(" X"), xPortion->getString());
-CPPUNIT_ASSERT(!xPortions->hasMoreElements());
-
-xPara.set(getParagraphOrTable(18), uno::UNO_QUERY);
-xPortions.set(xPara->createEnumeration());
-xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty(xPortion, 
"TextPortionType"));
-CPPUNIT_ASSERT_EQUAL(OUString("X "), xPortion->getString());
-xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty(xPortion, 
"TextPortionType"));
-CPPUNIT_ASSERT(!getProperty(xPortion, "IsCollapsed"));
-xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty(xPortion, 
"TextPortionType"));
-CPPUNIT_ASSERT_EQUAL(OUString(" "), xPortion->getString());
-xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty(xPortion, 
"TextPortionType"));
-CPPUNIT_ASSERT(!getProperty(xPortion, "IsCollapsed"));
-xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty(xPortion, 
"TextPortionType"));
-CPPUNIT_ASSERT_EQUAL(OUString(" X"), xPortion->getString());
-CPPUNIT_ASSERT(!xPortions->hasMoreElements());
-
 xPara.set(getParagraphOrTable(19), uno::UNO_QUERY);
 xPortions.set(xPara->createEnumeration());
 xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Regarding my work on grouping delete undo actions with Track Changes set

2017-08-06 Thread Rosemary Sebastian
Hello everyone

Currently we have a separate class SwUndoRedlineDelete to take care of undo
delete actions with Track Changes set. But the CanGrouping function in the
class does not serve any purpose in reality.

>From what I understand making the function work again would mean
reimplementing the undo-redo mechanisms that are already implemented in
SwUndoDelete class. So I propose that we drop the SwUndoRedlineDelete class
and instead rework the SwUndoDelete class to handle redline delete
undo-redo actions as well.

Due to lack of feedback on gerrit, I created a remote feature branch
feature/sw-delete-undo-rework for this task. You can track the progress
here:
https://cgit.freedesktop.org/libreoffice/core/log/?h=feature/sw-delete-undo-rework
.


If you have any concerns regarding my work, please write to the mailing
list. I would love to hear any feedback or comments.

Regards
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Changes to 'private/Rosemary/change-tracking'

2017-08-06 Thread Rosemary Sebastian
New branch 'private/Rosemary/change-tracking' available with the following 
commits:
commit d2477ceb9fd3b00b9d1f95ccbc0e3d047bb5ed17
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Mon Jun 6 21:04:49 2016 +0530

Append namespaces ADD and DEL

Change-Id: I56ddfaa7f7facfc9c2359cd50031e6531ed05120

commit 51d32ed38ba6e70f3f259cf937d97d7ac4447e1b
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Tue May 24 17:52:41 2016 +0530

Create undo.xml for change-tracking

Change-Id: I41a6de97b5c377e9a5c528c920d5c6e0195b7a10
Reviewed-on: https://gerrit.libreoffice.org/25404
Reviewed-by: Rosemary Sebastian <rosemarys...@gmail.com>
Tested-by: Rosemary Sebastian <rosemarys...@gmail.com>

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'feature/sw-delete-undo-rework'

2017-08-06 Thread Rosemary Sebastian
New branch 'feature/sw-delete-undo-rework' available with the following commits:
commit d02333d3e9376ccd978c9f954a64e351acc342d5
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Jul 17 16:31:36 2017 +0530

tdf#109151: Enable grouping of undo actions for delete redlines

Change-Id: I74183e5df58d8d0c5e892182f545a5ff17eb7936

commit 8345aeea1e5a38b3a1151fbc2b141ead577bfb2f
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Sat Jul 22 17:28:42 2017 +0530

tdf#109272: Correct the cursor position for selection delete ...

... with Backspace, in change-tracking.

Change-Id: I3b7d393fc342c296c5ead8e0463fcc5325cbd606

commit bd37233020266a5892d6ec7022688e3dfb9cef75
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Sat Jul 22 15:24:45 2017 +0530

tdf#109267: Fix crash during undo of delete inside redline insert

Change-Id: I070ce600c10f469b914cc1d6c036a55f33dc9529

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/change-tracking' - sw/source

2017-08-02 Thread Rosemary Sebastian
 sw/source/uibase/wrtsh/delete.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 296e2758a2481f34c8263db3a1171e5054526bad
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Sat Jul 22 17:28:42 2017 +0530

tdf#109272: Correct the cursor position for selection delete ...

... with Backspace, in change-tracking.

Change-Id: I3b7d393fc342c296c5ead8e0463fcc5325cbd606
Reviewed-on: https://gerrit.libreoffice.org/40670
Reviewed-by: Rosemary Sebastian <rosemarys...@gmail.com>
    Tested-by: Rosemary Sebastian <rosemarys...@gmail.com>

diff --git a/sw/source/uibase/wrtsh/delete.cxx 
b/sw/source/uibase/wrtsh/delete.cxx
index 8ce3d4222ff2..62d95cb7ef00 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -153,6 +153,7 @@ long SwWrtShell::DelLeft()
 {
 SwActContext aActContext(this);
 ResetCursorStack();
+SwapPam();   // SwapPam() is required for change-tracking
 Delete();
 UpdateAttr();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2017-07-05 Thread Rosemary Sebastian
 sw/source/core/doc/DocumentContentOperationsManager.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 054dab1b9d4985c473e07c2618e5d6bf6ebc5466
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Wed Jul 5 10:14:05 2017 +0530

nitpick, tdf#107340 follow-up

Remove unwanted variable

Change-Id: Ie1f193b55a5c957e38e8499d6d5701441bc2b7e3
Reviewed-on: https://gerrit.libreoffice.org/39547
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Rosemary Sebastian <rosemarys...@gmail.com>
Tested-by: Rosemary Sebastian <rosemarys...@gmail.com>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 362d6c8efc02..e7448e881816 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3558,8 +3558,7 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa
 
 pUndo = new SwUndoRedlineDelete( rPam, SwUndoId::DELETE );
 const SwRewriter aRewriter = pUndo->GetRewriter();
-const SwRewriter* const pRewriter = 
-m_rDoc.GetIDocumentUndoRedo().StartUndo( SwUndoId::DELETE, 
pRewriter );
+m_rDoc.GetIDocumentUndoRedo().StartUndo( SwUndoId::DELETE, 
 );
 m_rDoc.GetIDocumentUndoRedo().AppendUndo( pUndo );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2017-07-04 Thread Rosemary Sebastian
 sw/source/core/doc/DocumentContentOperationsManager.cxx |4 ++-
 sw/source/core/inc/UndoRedline.hxx  |5 
 sw/source/core/undo/unredln.cxx |   18 
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit fe25f95c3de542f15f6043c85f7385cd7569f237
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Jul 3 17:18:39 2017 +0530

tdf#107340 - Incorrect undo label with Track Changes set

Override the GetRewriter() function for the class SwUndoRedlineDelete

Change-Id: I4f7080d9d8eb79757e3e915b51f157bee29e9334
Reviewed-on: https://gerrit.libreoffice.org/39472
Reviewed-by: Michael Stahl <mst...@redhat.com>
Tested-by: Michael Stahl <mst...@redhat.com>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index f934965cb3b9..362d6c8efc02 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3556,8 +3556,10 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa
 m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags(
 RedlineFlags::On | RedlineFlags::ShowInsert | 
RedlineFlags::ShowDelete );
 
-m_rDoc.GetIDocumentUndoRedo().StartUndo( SwUndoId::DELETE, nullptr 
);
 pUndo = new SwUndoRedlineDelete( rPam, SwUndoId::DELETE );
+const SwRewriter aRewriter = pUndo->GetRewriter();
+const SwRewriter* const pRewriter = 
+m_rDoc.GetIDocumentUndoRedo().StartUndo( SwUndoId::DELETE, 
pRewriter );
 m_rDoc.GetIDocumentUndoRedo().AppendUndo( pUndo );
 }
 
diff --git a/sw/source/core/inc/UndoRedline.hxx 
b/sw/source/core/inc/UndoRedline.hxx
index 8a62b33937a5..8cf4e63f3f57 100644
--- a/sw/source/core/inc/UndoRedline.hxx
+++ b/sw/source/core/inc/UndoRedline.hxx
@@ -56,17 +56,22 @@ class SwUndoRedlineDelete : public SwUndoRedline
 bool bIsDelim : 1;
 bool bIsBackspace : 1;
 
+OUString m_sRedlineText;
+
 virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
 virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
 
 public:
 SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUserId );
+virtual SwRewriter GetRewriter() const override;
 
 bool CanGrouping( const SwUndoRedlineDelete& rPrev );
 
 // SwUndoTableCpyTable needs this information:
 long NodeDiff() const { return nSttNode - nEndNode; }
 sal_Int32 ContentStart() const { return nSttContent; }
+
+void SetRedlineText(const OUString & rText);
 };
 
 class SwUndoRedlineSort : public SwUndoRedline
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 2f9cd4f49b87..2f08ed55d893 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -146,6 +147,7 @@ SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& 
rRange, SwUndoId nUsrId )
 bCanGroup( false ), bIsDelim( false ), bIsBackspace( false )
 {
 const SwTextNode* pTNd;
+SetRedlineText(rRange.GetText());
 if( SwUndoId::DELETE == mnUserId &&
 nSttNode == nEndNode && nSttContent + 1 == nEndContent &&
 nullptr != (pTNd = rRange.GetNode().GetTextNode()) )
@@ -163,6 +165,22 @@ SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& 
rRange, SwUndoId nUsrId )
 bCacheComment = false;
 }
 
+SwRewriter SwUndoRedlineDelete::GetRewriter() const
+{
+SwRewriter aResult;
+OUString aStr = m_sRedlineText;
+aStr = DenoteSpecialCharacters(aStr);
+aStr = ShortenString(aStr, nUndoStringLength, SwResId(STR_LDOTS));
+aResult.AddRule(UndoArg1, aStr);
+return aResult;
+}
+
+
+void SwUndoRedlineDelete::SetRedlineText(const OUString & rText)
+{
+m_sRedlineText = rText;
+}
+
 void SwUndoRedlineDelete::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
 {
 rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, USHRT_MAX);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sd/qa xmloff/inc xmloff/source

2017-03-18 Thread Rosemary Sebastian
 editeng/source/items/flditem.cxx |   15 +--
 sd/qa/unit/data/odp/author_fixed.odp |binary
 sd/qa/unit/export-tests.cxx  |   19 +++
 xmloff/inc/txtfldi.hxx   |4 
 xmloff/source/text/txtflde.cxx   |7 +--
 xmloff/source/text/txtfldi.cxx   |   10 ++
 6 files changed, 47 insertions(+), 8 deletions(-)

New commits:
commit 109210e5b71a4e0b6fcaae72be7ef8d7667f3708
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sat Mar 18 08:46:27 2017 +

Revert "Revert "Implement export and import of author field in fixed 
format""

This reverts commit cae16645e17df6a1f87443c00b6abfd26dabd27f.

Change-Id: If5b85beb53a0925909d537023879a7d86fa011cf
Reviewed-on: https://gerrit.libreoffice.org/35391
Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Rosemary Sebastian <rosemarys...@gmail.com>
Tested-by: Rosemary Sebastian <rosemarys...@gmail.com>

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 1d5ba3fa784e..690425594227 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -181,13 +181,16 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 SvxAuthorField* pData = new SvxAuthorField(
 aFirstName, aLastName, OUString(), bIsFixed ? 
SVXAUTHORTYPE_FIX : SVXAUTHORTYPE_VAR);
 
-if (!bFullName)
+if (!bIsFixed)
 {
-pData->SetFormat(SVXAUTHORFORMAT_SHORTNAME);
-}
-else if (nFmt >= SVXAUTHORFORMAT_FULLNAME && nFmt <= 
SVXAUTHORFORMAT_SHORTNAME)
-{
-pData->SetFormat(static_cast(nFmt));
+if (!bFullName)
+{
+pData->SetFormat(SVXAUTHORFORMAT_SHORTNAME);
+}
+else if (nFmt >= SVXAUTHORFORMAT_FULLNAME && nFmt <= 
SVXAUTHORFORMAT_SHORTNAME)
+{
+
pData->SetFormat(static_cast(nFmt));
+}
 }
 
 return pData;
diff --git a/sd/qa/unit/data/odp/author_fixed.odp 
b/sd/qa/unit/data/odp/author_fixed.odp
new file mode 100644
index ..2e666ad17fee
Binary files /dev/null and b/sd/qa/unit/data/odp/author_fixed.odp differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 797bf36d6192..dd57ec01bf3d 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -92,6 +92,7 @@ public:
 void testTdf62176();
 void testTransparentBackground();
 void testEmbeddedPdf();
+void testAuthorField();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
 
@@ -106,6 +107,7 @@ public:
 CPPUNIT_TEST(testTdf62176);
 CPPUNIT_TEST(testTransparentBackground);
 CPPUNIT_TEST(testEmbeddedPdf);
+CPPUNIT_TEST(testAuthorField);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -552,6 +554,23 @@ void SdExportTest::testEmbeddedPdf()
 #endif
 }
 
+void SdExportTest::testAuthorField()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/author_fixed.odp"), 
ODP);
+
+xDocShRef = saveAndReload( xDocShRef.get(), ODP );
+
+uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 
0, xDocShRef);
+CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
+
+uno::Reference< beans::XPropertySet > xPropSet( xField, 
uno::UNO_QUERY_THROW );
+bool bFixed = false;
+xPropSet->getPropertyValue("IsFixed") >>= bFixed;
+CPPUNIT_ASSERT_MESSAGE("Author field is not fixed", bFixed);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx
index 106545c34503..ed154c72ffe0 100644
--- a/xmloff/inc/txtfldi.hxx
+++ b/xmloff/inc/txtfldi.hxx
@@ -234,6 +234,10 @@ protected:
 virtual void StartElement(
 const css::uno::Reference< css::xml::sax::XAttributeList> & xAttrList) 
override;
 
+/// process attribute values
+virtual void ProcessAttribute( sal_uInt16 nAttrToken,
+   const OUString& sAttrValue ) override;
+
 /// prepare XTextField for insertion into document
 virtual void PrepareField(
 const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) 
override;
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 4692856b96e2..91dba974616d 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -1055,8 +1055,11 @@ void XMLTextFieldExport::ExportFieldHelper(
 switch (nT

[Libreoffice-commits] core.git: editeng/source sd/qa xmloff/inc xmloff/source

2017-03-16 Thread Rosemary Sebastian
 dev/null |binary
 editeng/source/items/flditem.cxx |   15 ++-
 sd/qa/unit/export-tests.cxx  |   19 ---
 xmloff/inc/txtfldi.hxx   |4 
 xmloff/source/text/txtflde.cxx   |7 ++-
 xmloff/source/text/txtfldi.cxx   |   10 --
 6 files changed, 8 insertions(+), 47 deletions(-)

New commits:
commit cae16645e17df6a1f87443c00b6abfd26dabd27f
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Thu Mar 16 15:25:26 2017 +

Revert "Implement export and import of author field in fixed format"

This reverts commit 5de40734af30a8b897c6c5b7f681759e36a25557.

Change-Id: Ib09fb1dc54066cadcd9503c92140d78e7482ae6c
Reviewed-on: https://gerrit.libreoffice.org/35281
    Reviewed-by: Rosemary Sebastian <rosemarys...@gmail.com>
    Tested-by: Rosemary Sebastian <rosemarys...@gmail.com>

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 690425594227..1d5ba3fa784e 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -181,16 +181,13 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 SvxAuthorField* pData = new SvxAuthorField(
 aFirstName, aLastName, OUString(), bIsFixed ? 
SVXAUTHORTYPE_FIX : SVXAUTHORTYPE_VAR);
 
-if (!bIsFixed)
+if (!bFullName)
 {
-if (!bFullName)
-{
-pData->SetFormat(SVXAUTHORFORMAT_SHORTNAME);
-}
-else if (nFmt >= SVXAUTHORFORMAT_FULLNAME && nFmt <= 
SVXAUTHORFORMAT_SHORTNAME)
-{
-
pData->SetFormat(static_cast(nFmt));
-}
+pData->SetFormat(SVXAUTHORFORMAT_SHORTNAME);
+}
+else if (nFmt >= SVXAUTHORFORMAT_FULLNAME && nFmt <= 
SVXAUTHORFORMAT_SHORTNAME)
+{
+pData->SetFormat(static_cast(nFmt));
 }
 
 return pData;
diff --git a/sd/qa/unit/data/odp/author_fixed.odp 
b/sd/qa/unit/data/odp/author_fixed.odp
deleted file mode 100644
index 2e666ad17fee..
Binary files a/sd/qa/unit/data/odp/author_fixed.odp and /dev/null differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index dd57ec01bf3d..797bf36d6192 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -92,7 +92,6 @@ public:
 void testTdf62176();
 void testTransparentBackground();
 void testEmbeddedPdf();
-void testAuthorField();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
 
@@ -107,7 +106,6 @@ public:
 CPPUNIT_TEST(testTdf62176);
 CPPUNIT_TEST(testTransparentBackground);
 CPPUNIT_TEST(testEmbeddedPdf);
-CPPUNIT_TEST(testAuthorField);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -554,23 +552,6 @@ void SdExportTest::testEmbeddedPdf()
 #endif
 }
 
-void SdExportTest::testAuthorField()
-{
-::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/author_fixed.odp"), 
ODP);
-
-xDocShRef = saveAndReload( xDocShRef.get(), ODP );
-
-uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 
0, xDocShRef);
-CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
-
-uno::Reference< beans::XPropertySet > xPropSet( xField, 
uno::UNO_QUERY_THROW );
-bool bFixed = false;
-xPropSet->getPropertyValue("IsFixed") >>= bFixed;
-CPPUNIT_ASSERT_MESSAGE("Author field is not fixed", bFixed);
-
-xDocShRef->DoClose();
-}
-
 CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx
index ed154c72ffe0..106545c34503 100644
--- a/xmloff/inc/txtfldi.hxx
+++ b/xmloff/inc/txtfldi.hxx
@@ -234,10 +234,6 @@ protected:
 virtual void StartElement(
 const css::uno::Reference< css::xml::sax::XAttributeList> & xAttrList) 
override;
 
-/// process attribute values
-virtual void ProcessAttribute( sal_uInt16 nAttrToken,
-   const OUString& sAttrValue ) override;
-
 /// prepare XTextField for insertion into document
 virtual void PrepareField(
 const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) 
override;
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 91dba974616d..4692856b96e2 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -1055,11 +1055,8 @@ void XMLTextFieldExport::ExportFieldHelper(
 switch (nToken) {
 case FIELD_ID_AUTHOR:
 // author field: fixed,

[Libreoffice-commits] core.git: editeng/source sd/qa xmloff/inc xmloff/source

2017-03-09 Thread Rosemary Sebastian
 editeng/source/items/flditem.cxx |   15 +--
 sd/qa/unit/data/odp/author_fixed.odp |binary
 sd/qa/unit/export-tests.cxx  |   19 +++
 xmloff/inc/txtfldi.hxx   |4 
 xmloff/source/text/txtflde.cxx   |7 +--
 xmloff/source/text/txtfldi.cxx   |   10 ++
 6 files changed, 47 insertions(+), 8 deletions(-)

New commits:
commit 5de40734af30a8b897c6c5b7f681759e36a25557
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Wed Jan 25 12:56:47 2017 +0530

Implement export and import of author field in fixed format

Change-Id: I1975bfcdc8436f2b05e2fab2a4c9c09838330b30
Reviewed-on: https://gerrit.libreoffice.org/33520
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Rosemary Sebastian <rosemarys...@gmail.com>

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 1d5ba3f..6904255 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -181,13 +181,16 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 SvxAuthorField* pData = new SvxAuthorField(
 aFirstName, aLastName, OUString(), bIsFixed ? 
SVXAUTHORTYPE_FIX : SVXAUTHORTYPE_VAR);
 
-if (!bFullName)
+if (!bIsFixed)
 {
-pData->SetFormat(SVXAUTHORFORMAT_SHORTNAME);
-}
-else if (nFmt >= SVXAUTHORFORMAT_FULLNAME && nFmt <= 
SVXAUTHORFORMAT_SHORTNAME)
-{
-pData->SetFormat(static_cast(nFmt));
+if (!bFullName)
+{
+pData->SetFormat(SVXAUTHORFORMAT_SHORTNAME);
+}
+else if (nFmt >= SVXAUTHORFORMAT_FULLNAME && nFmt <= 
SVXAUTHORFORMAT_SHORTNAME)
+{
+
pData->SetFormat(static_cast(nFmt));
+}
 }
 
 return pData;
diff --git a/sd/qa/unit/data/odp/author_fixed.odp 
b/sd/qa/unit/data/odp/author_fixed.odp
new file mode 100644
index 000..2e666ad
Binary files /dev/null and b/sd/qa/unit/data/odp/author_fixed.odp differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 797bf36..dd57ec0 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -92,6 +92,7 @@ public:
 void testTdf62176();
 void testTransparentBackground();
 void testEmbeddedPdf();
+void testAuthorField();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
 
@@ -106,6 +107,7 @@ public:
 CPPUNIT_TEST(testTdf62176);
 CPPUNIT_TEST(testTransparentBackground);
 CPPUNIT_TEST(testEmbeddedPdf);
+CPPUNIT_TEST(testAuthorField);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -552,6 +554,23 @@ void SdExportTest::testEmbeddedPdf()
 #endif
 }
 
+void SdExportTest::testAuthorField()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/author_fixed.odp"), 
ODP);
+
+xDocShRef = saveAndReload( xDocShRef.get(), ODP );
+
+uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 
0, xDocShRef);
+CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
+
+uno::Reference< beans::XPropertySet > xPropSet( xField, 
uno::UNO_QUERY_THROW );
+bool bFixed = false;
+xPropSet->getPropertyValue("IsFixed") >>= bFixed;
+CPPUNIT_ASSERT_MESSAGE("Author field is not fixed", bFixed);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx
index 106545c..ed154c7 100644
--- a/xmloff/inc/txtfldi.hxx
+++ b/xmloff/inc/txtfldi.hxx
@@ -234,6 +234,10 @@ protected:
 virtual void StartElement(
 const css::uno::Reference< css::xml::sax::XAttributeList> & xAttrList) 
override;
 
+/// process attribute values
+virtual void ProcessAttribute( sal_uInt16 nAttrToken,
+   const OUString& sAttrValue ) override;
+
 /// prepare XTextField for insertion into document
 virtual void PrepareField(
 const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) 
override;
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 4037bab..72dc79a 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -1067,8 +1067,11 @@ void XMLTextFieldExport::ExportFieldHelper(
 switch (nToken) {
 case FIELD_ID_AUTHOR:
 // author field: fixed, field (sub-)type
-ProcessBoolean(XML_FIXED,
-   GetBoolProperty(sPropertyIsFixed, rPropSet),

[Libreoffice-commits] core.git: sc/source

2017-01-29 Thread Rosemary Sebastian
 sc/source/filter/xcl97/XclExpChangeTrack.cxx |   13 +++--
 sc/source/filter/xcl97/xcl97rec.cxx  |   15 ---
 2 files changed, 15 insertions(+), 13 deletions(-)

New commits:
commit c6dd735afb2e1b3837c4f8c5659f52fafab4c56f
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Sun Jan 29 23:08:01 2017 +0530

replace namespace url strings with function calls

Change-Id: I3c0ca35c6f6acdd0f00a2aff4c9ef49d110cc1a2
Reviewed-on: https://gerrit.libreoffice.org/33664
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx 
b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 9ba10de..b1d7ce6 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -26,6 +26,7 @@
 #include "document.hxx"
 #include "editutil.hxx"
 
+#include 
 #include 
 #include 
 #include 
@@ -377,8 +378,8 @@ void XclExpXmlChTrHeaders::SaveXml( XclExpXmlStream& rStrm )
 pHeaders->write("<")->writeId(XML_headers);
 
 rStrm.WriteAttributes(
-XML_xmlns,  
"http://schemas.openxmlformats.org/spreadsheetml/2006/main;,
-FSNS(XML_xmlns, XML_r), 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships;,
+XML_xmlns,  
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+FSNS(XML_xmlns, XML_r), 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
 XML_guid,   lcl_GuidToOString(maGUID).getStr(),
 XML_lastGuid,   nullptr,   // OOXTODO
 XML_shared, nullptr,   // OOXTODO
@@ -470,8 +471,8 @@ void XclExpXmlChTrHeader::SaveXml( XclExpXmlStream& rStrm )
 pRevLogStrm->write("<")->writeId(XML_revisions);
 
 rStrm.WriteAttributes(
-XML_xmlns,  
"http://schemas.openxmlformats.org/spreadsheetml/2006/main;,
-FSNS(XML_xmlns, XML_r), 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships;,
+XML_xmlns,  
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+FSNS(XML_xmlns, XML_r), 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
 FSEND);
 
 pRevLogStrm->write(">");
@@ -1645,8 +1646,8 @@ static void lcl_WriteUserNamesXml( XclExpXmlStream& 
rWorkbookStrm )
 
"application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml",
 CREATE_OFFICEDOC_RELATION_TYPE("usernames"));
 pUserNames->startElement( XML_users,
-XML_xmlns,  
"http://schemas.openxmlformats.org/spreadsheetml/2006/main;,
-FSNS( XML_xmlns, XML_r ),   
"http://schemas.openxmlformats.org/officeDocument/2006/relationships;,
+XML_xmlns,  
XclXmlUtils::ToOString(rWorkbookStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+FSNS( XML_xmlns, XML_r ),   
XclXmlUtils::ToOString(rWorkbookStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
 XML_count,  "0",
 FSEND );
 // OOXTODO: XML_userinfo elements for each user editing the file
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 3c94c05..4d1c3c0 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -73,6 +73,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -260,9 +261,9 @@ void SaveDrawingMLObjects( XclExpObjList& rList, 
XclExpXmlStream& rStrm, sal_Int
 
 rStrm.PushStream( pDrawing );
 pDrawing->startElement( FSNS( XML_xdr, XML_wsDr ),
-FSNS( XML_xmlns, XML_xdr ), 
"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing;,
-FSNS( XML_xmlns, XML_a ),   
"http://schemas.openxmlformats.org/drawingml/2006/main;,
-FSNS( XML_xmlns, XML_r ),   
"http://schemas.openxmlformats.org/officeDocument/2006/relationships;,
+FSNS( XML_xmlns, XML_xdr ), 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(dmlSpreadDr))).getStr(),
+FSNS( XML_xmlns, XML_a ),   
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(dml))).getStr(),
+FSNS( XML_xmlns, XML_r ),   
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
 FSEND );
 
 for (it = aList.begin(), itEnd = aList.end(); it != itEnd; ++it)
@@ -294,10 +295,10 @@ void SaveVmlObjects( XclExpObjList& rList, 
XclExpXmlStream& rStrm, sal_Int32& nV
 
 rStrm.PushStream( pVmlDrawing );
 pVmlDrawing->startElement( XML_xml,
-FSNS( XML_xmlns, XML_v ),   "urn:schemas-microsoft-com:vml",
-FS

[Libreoffice-commits] core.git: sc/source

2017-01-13 Thread Rosemary Sebastian
 sc/source/filter/excel/xedbdata.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 95cf7fa25d3b950e0cb576a1e864b54f1a43bc7a
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Fri Jan 13 09:41:14 2017 +0100

tdf#105272: fix wrong namespace URL

regression from f1dcb8b3e2e01848d44dd1beb82cd4e6e68a2acd

Change-Id: I088894711617bd762bf4e9352ddf6d850a5cbe7b

diff --git a/sc/source/filter/excel/xedbdata.cxx 
b/sc/source/filter/excel/xedbdata.cxx
index 7c9d48a..92cb15b 100644
--- a/sc/source/filter/excel/xedbdata.cxx
+++ b/sc/source/filter/excel/xedbdata.cxx
@@ -181,7 +181,7 @@ void XclExpTables::SaveTableXml( XclExpXmlStream& rStrm, 
const Entry& rEntry )
 rData.GetArea( aRange);
 sax_fastparser::FSHelperPtr& pTableStrm = rStrm.GetCurrentStream();
 pTableStrm->startElement( XML_table,
-XML_xmlns, 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls14Lst))).getStr(),
+XML_xmlns, 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
 XML_id, OString::number( rEntry.mnTableId).getStr(),
 XML_name, XclXmlUtils::ToOString( rData.GetName()).getStr(),
 XML_displayName, XclXmlUtils::ToOString( rData.GetName()).getStr(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2017-01-10 Thread Rosemary Sebastian
 sw/source/filter/ww8/docxattributeoutput.cxx |   21 ---
 sw/source/filter/ww8/docxexport.cxx  |   37 +--
 sw/source/filter/ww8/docxexport.hxx  |2 -
 sw/source/filter/ww8/docxsdrexport.cxx   |   13 +
 4 files changed, 38 insertions(+), 35 deletions(-)

New commits:
commit 28f50d7e387864bd41a67b2fb78b9c98a708a00e
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Jan 9 11:47:19 2017 +0530

replace namespace url strings with function calls

Change-Id: I6e0c4c94ba7418ed9d7daa7f768baf703e22ab55
Reviewed-on: https://gerrit.libreoffice.org/32915
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index ff0c60c..8ac45b2 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3774,9 +3775,9 @@ void DocxAttributeOutput::TableRowEnd( sal_uInt32 
/*nDepth*/ )
 void DocxAttributeOutput::StartStyles()
 {
 m_pSerializer->startElementNS( XML_w, XML_styles,
-FSNS( XML_xmlns, XML_w ),   
"http://schemas.openxmlformats.org/wordprocessingml/2006/main;,
-FSNS( XML_xmlns, XML_w14 ), 
"http://schemas.microsoft.com/office/word/2010/wordml;,
-FSNS( XML_xmlns, XML_mc ),  
"http://schemas.openxmlformats.org/markup-compatibility/2006;,
+FSNS( XML_xmlns, XML_w ),   
OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(doc)), 
RTL_TEXTENCODING_UTF8).getStr(),
+FSNS( XML_xmlns, XML_w14 ), 
OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(w14)), 
RTL_TEXTENCODING_UTF8).getStr(),
+FSNS( XML_xmlns, XML_mc ),  
OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(mce)), 
RTL_TEXTENCODING_UTF8).getStr(),
 FSNS( XML_mc, XML_Ignorable ), "w14",
 FSEND );
 
@@ -4291,20 +4292,20 @@ void DocxAttributeOutput::FlyFrameGraphic( const 
SwGrfNode* pGrfNode, const Size
 FSEND );
 // TODO change aspect?
 m_pSerializer->singleElementNS( XML_a, XML_graphicFrameLocks,
-FSNS( XML_xmlns, XML_a ), 
"http://schemas.openxmlformats.org/drawingml/2006/main;,
+FSNS( XML_xmlns, XML_a ), 
OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(dml)), 
RTL_TEXTENCODING_UTF8).getStr(),
 XML_noChangeAspect, "1",
 FSEND );
 m_pSerializer->endElementNS( XML_wp, XML_cNvGraphicFramePr );
 
 m_pSerializer->startElementNS( XML_a, XML_graphic,
-FSNS( XML_xmlns, XML_a ), 
"http://schemas.openxmlformats.org/drawingml/2006/main;,
+FSNS( XML_xmlns, XML_a ), 
OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(dml)), 
RTL_TEXTENCODING_UTF8).getStr(),
 FSEND );
 m_pSerializer->startElementNS( XML_a, XML_graphicData,
 XML_uri, 
"http://schemas.openxmlformats.org/drawingml/2006/picture;,
 FSEND );
 
 m_pSerializer->startElementNS( XML_pic, XML_pic,
-FSNS( XML_xmlns, XML_pic ), 
"http://schemas.openxmlformats.org/drawingml/2006/picture;,
+FSNS( XML_xmlns, XML_pic ), 
OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(dmlPicture)), 
RTL_TEXTENCODING_UTF8).getStr(),
 FSEND );
 
 m_pSerializer->startElementNS( XML_pic, XML_nvPicPr,
@@ -4509,7 +4510,7 @@ void DocxAttributeOutput::WritePostponedChart()
 FSEND );
 
 m_pSerializer->startElementNS( XML_a, XML_graphic,
-FSNS( XML_xmlns, XML_a ), 
"http://schemas.openxmlformats.org/drawingml/2006/main;,
+FSNS( XML_xmlns, XML_a ), 
OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(dml)), 
RTL_TEXTENCODING_UTF8).getStr(),
 FSEND );
 
 m_pSerializer->startElementNS( XML_a, XML_graphicData,
@@ -4522,8 +4523,8 @@ void DocxAttributeOutput::WritePostponedChart()
 aRelId = m_rExport.OutputChart( xModel, m_nChartCount, m_pSerializer );
 
 m_pSerializer->singleElementNS( XML_c, XML_chart,
-FSNS( XML_xmlns, XML_c ), 
"http://schemas.openxmlformats.org/drawingml/2006/chart;,
-FSNS( XML_xmlns, XML_r ), 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships;,
+FSNS( XML_xmlns, XML_c ), 
OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(dmlChart)), 
RTL_TEXTENCODING_UTF8).getStr(),
+FSNS( XML_xmlns, XML_r ), 
OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(officeRel)), 
RTL_TEXTENCODING_UTF8).getStr(),
 FSNS( XML_r, XML_id ), aRelId.getStr(),
 FSEND );
 
@

[Libreoffice-commits] core.git: sd/source

2017-01-10 Thread Rosemary Sebastian
 sd/source/filter/eppt/pptx-epptooxml.cxx |   19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

New commits:
commit 54490d9322dfeb97142885de043d5710dad673ed
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Tue Jan 10 10:17:37 2017 +0530

replace namespace url strings with function calls

Change-Id: I1b496a93449caa4a9699f71874f293eeaa1fa320
Reviewed-on: https://gerrit.libreoffice.org/32916
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 5f1b8e1..702dc58 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -67,12 +68,12 @@
 #include 
 
 // presentation namespaces
-#define PNMSS FSNS(XML_xmlns, XML_a),   
"http://schemas.openxmlformats.org/drawingml/2006/main;, \
-  FSNS(XML_xmlns, XML_p),   
"http://schemas.openxmlformats.org/presentationml/2006/main;, \
-  FSNS(XML_xmlns, XML_r),   
"http://schemas.openxmlformats.org/officeDocument/2006/relationships;, \
-  FSNS(XML_xmlns, XML_p14), 
"http://schemas.microsoft.com/office/powerpoint/2010/main;, \
-  FSNS(XML_xmlns, XML_p15), 
"http://schemas.microsoft.com/office/powerpoint/2012/main;, \
-  FSNS(XML_xmlns, XML_mc),  
"http://schemas.openxmlformats.org/markup-compatibility/2006;
+#define PNMSS FSNS(XML_xmlns, XML_a),   
OUStringToOString(this->getNamespaceURL(OOX_NS(dml)), 
RTL_TEXTENCODING_UTF8).getStr(), \
+  FSNS(XML_xmlns, XML_p),   
OUStringToOString(this->getNamespaceURL(OOX_NS(ppt)), 
RTL_TEXTENCODING_UTF8).getStr(), \
+  FSNS(XML_xmlns, XML_r),   
OUStringToOString(this->getNamespaceURL(OOX_NS(officeRel)), 
RTL_TEXTENCODING_UTF8).getStr(), \
+  FSNS(XML_xmlns, XML_p14), 
OUStringToOString(this->getNamespaceURL(OOX_NS(p14)), 
RTL_TEXTENCODING_UTF8).getStr(), \
+  FSNS(XML_xmlns, XML_p15), 
OUStringToOString(this->getNamespaceURL(OOX_NS(p15)), 
RTL_TEXTENCODING_UTF8).getStr(), \
+  FSNS(XML_xmlns, XML_mc),  
OUStringToOString(this->getNamespaceURL(OOX_NS(mce)), 
RTL_TEXTENCODING_UTF8).getStr()
 
 
 using namespace ::com::sun::star;
@@ -1406,7 +1407,7 @@ void PowerPointExport::WriteAuthors()
  "commentAuthors.xml" );
 
 pFS->startElementNS( XML_p, XML_cmAuthorLst,
- FSNS( XML_xmlns, XML_p ), 
"http://schemas.openxmlformats.org/presentationml/2006/main;,
+ FSNS( XML_xmlns, XML_p ), 
OUStringToOString(this->getNamespaceURL(OOX_NS(ppt)), RTL_TEXTENCODING_UTF8),
  FSEND );
 
 for( const AuthorsMap::value_type& i : maAuthors ) {
@@ -1455,7 +1456,7 @@ bool PowerPointExport::WriteComments( sal_uInt32 nPageNum 
)
 
"application/vnd.openxmlformats-officedocument.presentationml.comments+xml" );
 
 pFS->startElementNS( XML_p, XML_cmLst,
- FSNS( XML_xmlns, XML_p ), 
"http://schemas.openxmlformats.org/presentationml/2006/main;,
+ FSNS( XML_xmlns, XML_p ), 
OUStringToOString(this->getNamespaceURL(OOX_NS(ppt)), RTL_TEXTENCODING_UTF8),
  FSEND );
 
 do {
@@ -2179,7 +2180,7 @@ void PowerPointExport::WriteTheme( sal_Int32 nThemeNum )
 
"application/vnd.openxmlformats-officedocument.theme+xml" );
 
 pFS->startElementNS( XML_a, XML_theme,
- FSNS( XML_xmlns, XML_a), 
"http://schemas.openxmlformats.org/drawingml/2006/main;,
+ FSNS( XML_xmlns, XML_a), 
OUStringToOString(this->getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8),
  XML_name, "Office Theme",
  FSEND );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: oox/source

2017-01-04 Thread Rosemary Sebastian
 oox/source/core/xmlfilterbase.cxx  |   18 +-
 oox/source/export/chartexport.cxx  |   13 -
 oox/source/export/drawingml.cxx|3 ++-
 oox/source/export/shapes.cxx   |6 --
 oox/source/token/namespaces-strict.txt |2 ++
 oox/source/token/namespaces.txt|2 ++
 6 files changed, 27 insertions(+), 17 deletions(-)

New commits:
commit 0fa23d9b499411407c1a0fed41e91f24d59d2ac0
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Wed Jan 4 09:43:27 2017 +0530

replace namespace URL strings with function calls...

Change-Id: I0b8b265df487aaeb76238013bc93c78e49a9e1a6
Reviewed-on: https://gerrit.libreoffice.org/32723
Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 85cfc9f..569110c 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -597,11 +597,11 @@ writeCoreProperties( XmlFilterBase& rSelf, const 
Reference< XDocumentProperties
 "docProps/core.xml",
 "application/vnd.openxmlformats-package.core-properties+xml" );
 pCoreProps->startElementNS( XML_cp, XML_coreProperties,
-FSNS( XML_xmlns, XML_cp ),  
"http://schemas.openxmlformats.org/package/2006/metadata/core-properties;,
-FSNS( XML_xmlns, XML_dc ),  
"http://purl.org/dc/elements/1.1/;,
-FSNS( XML_xmlns, XML_dcterms ), "http://purl.org/dc/terms/;,
-FSNS( XML_xmlns, XML_dcmitype ),"http://purl.org/dc/dcmitype/;,
-FSNS( XML_xmlns, XML_xsi ), 
"http://www.w3.org/2001/XMLSchema-instance;,
+FSNS( XML_xmlns, XML_cp ),  
OUStringToOString(rSelf.getNamespaceURL(OOX_NS(packageMetaCorePr)), 
RTL_TEXTENCODING_UTF8).getStr(),
+FSNS( XML_xmlns, XML_dc ),  
OUStringToOString(rSelf.getNamespaceURL(OOX_NS(dc)), 
RTL_TEXTENCODING_UTF8).getStr(),
+FSNS( XML_xmlns, XML_dcterms ), 
OUStringToOString(rSelf.getNamespaceURL(OOX_NS(dcTerms)), 
RTL_TEXTENCODING_UTF8).getStr(),
+FSNS( XML_xmlns, XML_dcmitype ),
OUStringToOString(rSelf.getNamespaceURL(OOX_NS(dcmiType)), 
RTL_TEXTENCODING_UTF8).getStr(),
+FSNS( XML_xmlns, XML_xsi ), 
OUStringToOString(rSelf.getNamespaceURL(OOX_NS(xsi)), 
RTL_TEXTENCODING_UTF8).getStr(),
 FSEND );
 
 #ifdef OOXTODO
@@ -640,8 +640,8 @@ writeAppProperties( XmlFilterBase& rSelf, const Reference< 
XDocumentProperties >
 "docProps/app.xml",
 
"application/vnd.openxmlformats-officedocument.extended-properties+xml" );
 pAppProps->startElement( XML_Properties,
-XML_xmlns,  
"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties;,
-FSNS( XML_xmlns, XML_vt ),  
"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes;,
+XML_xmlns,  
OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeExtPr)), 
RTL_TEXTENCODING_UTF8).getStr(),
+FSNS( XML_xmlns, XML_vt ),  
OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT)), 
RTL_TEXTENCODING_UTF8).getStr(),
 FSEND );
 
 writeElement( pAppProps, XML_Template,  
xProperties->getTemplateName() );
@@ -742,8 +742,8 @@ writeCustomProperties( XmlFilterBase& rSelf, const 
Reference< XDocumentPropertie
 "docProps/custom.xml",
 
"application/vnd.openxmlformats-officedocument.custom-properties+xml" );
 pAppProps->startElement( XML_Properties,
-XML_xmlns,  
"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties;,
-FSNS( XML_xmlns, XML_vt ),  
"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes;,
+XML_xmlns,  
OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeCustomPr)), 
RTL_TEXTENCODING_UTF8).getStr(),
+FSNS( XML_xmlns, XML_vt ),  
OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT)), 
RTL_TEXTENCODING_UTF8).getStr(),
 FSEND );
 
 for ( sal_Int32 n = 0; n < nbCustomProperties; ++n )
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 79d0699..1bdd683 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include "oox/core/xmlfilterbase.hxx"
 #include "oox/export/chartexport.hxx"
@@ -594,9 +595,10 @@ void ChartExport::WriteChartObj( const Reference< XShape 
>& xShape, sal_Int32 nC
 
"ht

[Libreoffice-commits] core.git: 2 commits - sc/source

2017-01-03 Thread Rosemary Sebastian
 sc/source/filter/excel/excdoc.cxx  |9 
 sc/source/filter/excel/xecontent.cxx   |2 -
 sc/source/filter/excel/xedbdata.cxx|3 +-
 sc/source/filter/excel/xeescher.cxx|   13 ++--
 sc/source/filter/excel/xeextlst.cxx|8 ---
 sc/source/filter/excel/xelink.cxx  |5 ++--
 sc/source/filter/excel/xepivotxml.cxx  |   11 +-
 sc/source/filter/excel/xestyle.cxx |3 +-
 sc/source/filter/inc/sheetdatabuffer.hxx   |9 +++-
 sc/source/filter/oox/sheetdatabuffer.cxx   |   30 +
 sc/source/filter/oox/worksheetfragment.cxx |5 +---
 11 files changed, 51 insertions(+), 47 deletions(-)

New commits:
commit f1dcb8b3e2e01848d44dd1beb82cd4e6e68a2acd
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Tue Jan 3 18:31:43 2017 +0530

replace hard-coded namespace URL strings with function calls...

Follow-up for https://gerrit.libreoffice.org/#/c/32425/;

Change-Id: I59f77f0ccd681fb96bb9f1e7ec4b38d41c4f331a
Reviewed-on: https://gerrit.libreoffice.org/32695
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/filter/excel/excdoc.cxx 
b/sc/source/filter/excel/excdoc.cxx
index a1a2a75..cd1a466 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -76,6 +76,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace oox;
@@ -734,8 +735,8 @@ void ExcTable::WriteXml( XclExpXmlStream& rStrm )
 rStrm.PushStream( pWorksheet );
 
 pWorksheet->startElement( XML_worksheet,
-XML_xmlns, 
"http://schemas.openxmlformats.org/spreadsheetml/2006/main;,
-FSNS( XML_xmlns, XML_r ), 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships;,
+XML_xmlns, 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+FSNS( XML_xmlns, XML_r ), 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
 FSEND );
 
 SetCurrScTab( mnScTab );
@@ -855,8 +856,8 @@ void ExcDocument::WriteXml( XclExpXmlStream& rStrm )
 
 sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
 rWorkbook->startElement( XML_workbook,
-XML_xmlns, 
"http://schemas.openxmlformats.org/spreadsheetml/2006/main;,
-FSNS(XML_xmlns, XML_r), 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships;,
+XML_xmlns, 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+FSNS(XML_xmlns, XML_r), 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
 FSEND );
 rWorkbook->singleElement( XML_fileVersion,
 XML_appName, "Calc",
diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index b74eeb1..dae805f 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -204,7 +204,7 @@ void XclExpSstImpl::SaveXml( XclExpXmlStream& rStrm )
 rStrm.PushStream( pSst );
 
 pSst->startElement( XML_sst,
-XML_xmlns, 
"http://schemas.openxmlformats.org/spreadsheetml/2006/main;,
+XML_xmlns, 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
 XML_count, OString::number(  mnTotal ).getStr(),
 XML_uniqueCount, OString::number(  mnSize ).getStr(),
 FSEND );
diff --git a/sc/source/filter/excel/xedbdata.cxx 
b/sc/source/filter/excel/xedbdata.cxx
index 4c8e397..7c9d48a 100644
--- a/sc/source/filter/excel/xedbdata.cxx
+++ b/sc/source/filter/excel/xedbdata.cxx
@@ -13,6 +13,7 @@
 #include "dbdata.hxx"
 #include "document.hxx"
 #include 
+#include 
 
 using namespace oox;
 
@@ -180,7 +181,7 @@ void XclExpTables::SaveTableXml( XclExpXmlStream& rStrm, 
const Entry& rEntry )
 rData.GetArea( aRange);
 sax_fastparser::FSHelperPtr& pTableStrm = rStrm.GetCurrentStream();
 pTableStrm->startElement( XML_table,
-XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main;,
+XML_xmlns, 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls14Lst))).getStr(),
 XML_id, OString::number( rEntry.mnTableId).getStr(),
 XML_name, XclXmlUtils::ToOString( rData.GetName()).getStr(),
 XML_displayName, XclXmlUtils::ToOString( rData.GetName()).getStr(),
diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index 35fe29f..c783ea3 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -74,6 +74,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace com::sun::star;
@@ -1422,16 +1423,16 @@ void XclExpComments::SaveXml( XclExpXmlStream& rStrm )
 
 if( rStrm.

[Libreoffice-commits] core.git: Branch 'feature/change-tracking' - 3 commits - include/xmloff sw/source xmloff/source

2016-12-07 Thread Rosemary Sebastian
 include/xmloff/xmlnmspe.hxx |   14 +++---
 include/xmloff/xmltoken.hxx |6 --
 sw/source/filter/xml/xmlexp.cxx |9 +
 sw/source/filter/xml/xmlfmte.cxx|1 +
 xmloff/source/core/xmlexp.cxx   |6 --
 xmloff/source/core/xmltoken.cxx |6 --
 xmloff/source/text/XMLRedlineExport.cxx |8 
 7 files changed, 29 insertions(+), 21 deletions(-)

New commits:
commit 58da3ee237b7f203c4e54f756ee9d620bd8316c3
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Tue Oct 25 08:13:44 2016 +0530

Create a new namespace URL for attributes

The prefix "c" stands for changes or collaboration.
The URL is that of the OASIS subcommittee, which is

xmlns:c="https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office-collab;

Change-Id: I54d813588910bc2ea324873c8b41977e7ad6340c

diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx
index ae588d2..73dfb10 100644
--- a/include/xmloff/xmlnmspe.hxx
+++ b/include/xmloff/xmlnmspe.hxx
@@ -83,8 +83,9 @@ XML_NAMESPACE_EXT( CHART,   39U )
 XML_NAMESPACE_EXT( DRAW,40U )
 XML_NAMESPACE_EXT( CALC,41U )
 XML_NAMESPACE_EXT( LO,  42U )
+XML_NAMESPACE_EXT( C,   43U )
 
-#define XML_OLD_NAMESPACE_BASE 43U
+#define XML_OLD_NAMESPACE_BASE 44U
 
 // namespaces used in the technical preview (SO 5.2)
 XML_OLD_NAMESPACE( FO,  0U )
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 4ddc061..66076a7 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -156,6 +156,10 @@ namespace xmloff { namespace token {
 XML_NP_LO_EXT,
 XML_N_LO_EXT,
 
+// change-tracking
+XML_NP_C_EXT,
+XML_N_C_EXT,
+
 // units
 XML_UNIT_MM,
 XML_UNIT_M,
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 059bbd0..670eb0e 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -333,7 +333,7 @@ void SvXMLExport::InitCtor_()
 }
 
 // namespaces for documents
-if( getExportFlags() & 
(SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT)
 )
+if( getExportFlags() & 
(SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::UNDO)
 )
 {
 mpNamespaceMap->Add( GetXMLToken(XML_NP_DC),GetXMLToken(XML_N_DC), 
 XML_NAMESPACE_DC );
 mpNamespaceMap->Add( GetXMLToken(XML_NP_TEXT),  
GetXMLToken(XML_N_TEXT),XML_NAMESPACE_TEXT );
@@ -359,6 +359,9 @@ void SvXMLExport::InitCtor_()
 mpNamespaceMap->Add(
 GetXMLToken(XML_NP_LO_EXT), GetXMLToken(XML_N_LO_EXT),
 XML_NAMESPACE_LO_EXT);
+mpNamespaceMap->Add(
+GetXMLToken(XML_NP_C_EXT), GetXMLToken(XML_N_C_EXT),
+XML_NAMESPACE_C_EXT);
 mpNamespaceMap->Add( GetXMLToken(XML_NP_FIELD), 
GetXMLToken(XML_N_FIELD), XML_NAMESPACE_FIELD );
 }
 }
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 50920fd..9cc7f52 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -158,6 +158,10 @@ namespace xmloff { namespace token {
 TOKEN( "loext",   XML_NP_LO_EXT ),
 TOKEN( 
"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0", 
XML_N_LO_EXT ),
 
+// change-tracking
+TOKEN( "c",XML_NP_C_EXT ),
+TOKEN( 
"https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office-collab;,
  XML_N_C_EXT ),
+
 // units
 TOKEN( "mm",  XML_UNIT_MM ),
 TOKEN( "m",   XML_UNIT_M ),
diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index 3f24dda..91d962f 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -164,14 +164,14 @@ void XMLRedlineExport::ExportUndoChangedRegion(
 if( sUndoType == "paragraph" )
 {
 nParaIdx++;
-rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
rtl::OUString::number(nParaIdx));
+rExport.AddAttribute(XML_NAMESPACE_C_EXT, XML_START, "/" + 
rtl::OUString::number(nParaIdx));
 rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, XML_PARAGRAPH);
 }
 else
 {
-rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
rtl::OUString::number(nParaIdx) + "/" + rtl::OUString::number(nCharStart));
+rExport.AddAttribute(XML_NAMESPACE_C_EXT, XML_START, "/" + 
rtl::OUStr

[Libreoffice-commits] core.git: Changes to 'feature/change-tracking'

2016-09-08 Thread Rosemary Sebastian
New branch 'feature/change-tracking' available with the following commits:
commit cc046697174c878d184e183a1aa28a1167ede6f9
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Sat Jul 16 13:36:05 2016 +0530

WIP Insert redline into document

Change-Id: I51bb9e5572b0265c41cc17ae06f26a76b584fde3

commit a6bc6c2b7138b7de5dcd45944eb5321fbd16d53b
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Wed Jul 13 13:53:30 2016 +0530

WIP Insert redline into document

Change-Id: I98857e98503176c812b0fb70a41cb8e79637da78

commit 45675aed3b9c121266d78e37bccc00dbfbcda09b
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Wed Jul 13 06:28:30 2016 +0530

Access aRedlineMap when parsing content.xml

- Moved aRedlineMap to global scope.
- Made it two-dimensional with the first index indicating the paragraph
  index and the second indicating the text position within the paragraph.

Change-Id: I1c21040e258344c2c42e880fd30dc0efc3689815

commit 7b673a8524e43cfd2b445d386465d71d82e97dc5
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Jul 11 19:58:40 2016 +0530

WIP Insert redline into document

Change-Id: I477ef0dc0e62b83059dc5877746c16071a88507b

commit e9f5718b13865cd7988412f5d550657f5a4fbd2e
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Jul 4 16:19:18 2016 +0530

WIP Import text addition and deletion

Change-Id: Ibd960642e6361181c3ab983a2138019e7e7508f8

commit 6ef8bbca51c3774596794a6f52aaab29e532c57e
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Sat Jul 2 18:56:55 2016 +0530

Clean up code

Change-Id: I637e99315a43a9542988062bdde88f3e033ca8a4

commit 39816f01c52176d6a262e7684ab9535d9f0ebb61
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sat Jun 25 10:55:35 2016 +0530

Get text positions with changes applied

Change-Id: I5ceaad492380d00e55c84cfcf0d66a7c3f4cf9c1

commit 1668fda4bfd7d2681b440497da2ab37f45cf47b8
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Thu Jun 23 09:56:09 2016 +0530

Clean up code

Change-Id: Ib44e072f42620a9b17e813996a4ea817cb280da4

commit b4d0ec6e524cd9024d24c398cd911e1565e7495e
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Wed Jun 22 21:17:59 2016 +0530

Fix insertion of text and paragraph

Change-Id: I19488bf89e119fbdd5124e14cbc7aa27990321fc

commit 79651457952e910786474c9751178077ca121c06
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Wed Jun 22 14:37:36 2016 +0530

Implement export of insertion and deletion changes

Change-Id: I6a8b580dc43c744bb181961ff26c95acd10207cb

commit 376d7744306dc1f01d50bd7d436adc41b5405f9a
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sat Jun 18 23:58:20 2016 +0530

No need to mention the type for format changes

Change-Id: Idf59881cda5338d44c73702cfb55ce49df781075

commit 0e2e4319c5fd3232dbe09bb8fc18e2e48263643b
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sat Jun 18 23:30:17 2016 +0530

Get the correct start and end positions

Change-Id: I01db8d1556f8518e430e782d56a7310b1475dcb9

commit 70c230c10ad6ba678c00cf5b61235e7c261c7393
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Fri Jun 17 20:24:52 2016 +0530

Prevent crash

This is not the correct way to find the element type.
Hardcode the element type as "text" for now, to see the character
start and end positions in the resulting xml.

Change-Id: I254769ee922d6ecfd593e590293ee964878b0d0f

commit ef1380d84b36bf0f8d8bb5b77c2eabe4a0d04f61
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Fri Jun 17 19:32:04 2016 +0530

Get the start position of redline

Change-Id: I3fd5674b47e33f769cbb22203ab92444a1bb8d47

commit edd64d4304cdf6f18af08e573d0fa952391c7552
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Fri Jun 17 01:41:44 2016 +0530

WIP Get change-tracking information

Change-Id: I33982d37ec6b04c1325be5f03455df35d9eaaebe

commit 68a5a2baf0dce91569514edac2282d8da85fcb50
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Thu Jun 16 12:14:21 2016 +0530

Store changed element type

Change-Id: I7ab24494e6545cd5392c4507d3b469d0e78f357c

commit 8554bcbecdeeb709554712a711d75d69e4b5ec6e
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Thu Jun 16 16:49:17 2016 +0530

WIP Get start and end positions of redline

    Change-Id: I23550fb065eb36fd1be91826397e5d9d0034b0c7

commit 7b2d588fa7dd162c132103500774b278fc149e80
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Thu Jun 16 09:19:51 2016 +0530

No need to export changes inline
    
Change-Id: I11340715aa40fa490339e03c09509d334dc289dd

commit d24e473475b93f5c512a831570fa9c14f40ec0bf
Author: Rosemary Sebastian <r

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - sw/source xmloff/source

2016-07-19 Thread Rosemary Sebastian
 sw/source/filter/xml/XMLRedlineImportHelper.cxx   |   26 +-
 xmloff/source/text/XMLTrackedChangesImportContext.cxx |   13 ++---
 2 files changed, 11 insertions(+), 28 deletions(-)

New commits:
commit cc046697174c878d184e183a1aa28a1167ede6f9
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Sat Jul 16 13:36:05 2016 +0530

WIP Insert redline into document

Change-Id: I51bb9e5572b0265c41cc17ae06f26a76b584fde3

diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 0767c50..f95d944 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -511,29 +511,8 @@ void XMLRedlineImportHelper::InsertWithinParagraph(const 
OUString& rParaPos, boo
 {
 // RedlineInfo found; now set Cursor
 RedlineInfo* pInfo = aFind->second;
-if (bIsOutsideOfParagraph)
-{
-// outside of paragraph: remember SwNodeIndex
-if (bStart)
-{
-pInfo->aAnchorStart.SetAsNodeIndex(rRange);
-}
-else
-{
-pInfo->aAnchorEnd.SetAsNodeIndex(rRange);
-}
-
-// also remember that we expect an adjustment for this redline
-pInfo->bNeedsAdjustment = true;
-}
-else
-{
-// inside of a paragraph: use regular XTextRanges (bookmarks)
-if (bStart)
-pInfo->aAnchorStart.Set(rRange);
-else
-pInfo->aAnchorEnd.Set(rRange);
-}
+pInfo->aAnchorStart.Set(rRange);
+pInfo->aAnchorEnd.Set(rRange);
 
 // if this Cursor was the last missing info, we insert the
 // node into the document
@@ -722,7 +701,6 @@ void 
XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo)
 pRedline->SetMark();
 *(pRedline->GetMark()) = *aPaM.GetMark();
 }
-
 // set content node (if necessary)
 if (nullptr != pRedlineInfo->pContentIndex)
 {
diff --git a/xmloff/source/text/XMLTrackedChangesImportContext.cxx 
b/xmloff/source/text/XMLTrackedChangesImportContext.cxx
index ccd3f7b..244d655 100644
--- a/xmloff/source/text/XMLTrackedChangesImportContext.cxx
+++ b/xmloff/source/text/XMLTrackedChangesImportContext.cxx
@@ -108,10 +108,15 @@ SvXMLImportContext* 
XMLTrackedChangesImportContext::CreateChildContext(
 // from the ODF 1.2 standard :
 // The  element has the following child elements:
 // ,  and .
+OUString sChangeType;
 if ( IsXMLToken( rLocalName, XML_INSERTION ) ||
  IsXMLToken( rLocalName, XML_DELETION ) ||
  IsXMLToken( rLocalName, XML_FORMAT_CHANGE ) )
 {
+if( rLocalName == GetXMLToken( XML_INSERTION ) )
+sChangeType = GetXMLToken( XML_DELETION );
+else
+sChangeType = GetXMLToken( XML_INSERTION );
 sal_Int16 nLength = xAttrList->getLength();
 for( sal_Int16 i = 0; i < nLength; i++ )
 {
@@ -121,7 +126,7 @@ SvXMLImportContext* 
XMLTrackedChangesImportContext::CreateChildContext(
 const OUString sValue = xAttrList->getValueByIndex(i);
 if (XML_NAMESPACE_C == nPrefix)
 {
-if (IsXMLToken(sLocalName, xmloff::token::XML_START))
+if (IsXMLToken(sLocalName, XML_START))
 {
 sStart = sValue.pData->buffer + 1;
 if(sStart.indexOf('/') != -1)
@@ -156,12 +161,12 @@ SvXMLImportContext* 
XMLTrackedChangesImportContext::CreateChildContext(
 }
 }
 }
-SetChangeInfo( rLocalName, sAuthor, sComment, sDate, 
sStartParaPos, sStartTextPos );
+SetChangeInfo( sChangeType, sAuthor, sComment, sDate, 
sStartParaPos, sStartTextPos );
 
 // create XMLChangeElementImportContext for all kinds of changes
 pContext = new XMLChangeElementImportContext(
-GetImport(), nPrefix, rLocalName,
-IsXMLToken( rLocalName, XML_DELETION ),
+GetImport(), nPrefix, sChangeType,
+IsXMLToken( sChangeType, XML_DELETION ),
 *this);
 }
 // else: it may be a text element, see below
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


GSoC Week 8 Report

2016-07-18 Thread Rosemary Sebastian
Hello everyone

This week I've been working on import of the redlines of text type. I'm
currently trying to fix some faults during import such as the redline on
the first paragraph not showing up, the redline text being followed by a
new line on import and the redline positions getting altered during
roundtrip.

Regards
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


GSoC Week 7 Report

2016-07-13 Thread Rosemary Sebastian
Hello everyone

This week I continued with my work on import. For now I'm focussing only on
the import of text deletion/insertion and later I hope to extend it to
paragraphs as well.

I made some changes to enable store/access of redline info without using
change ids. So now redline info can be accessed using position numbers
instead of using change id.

Currently the plan is to resolve the position numbers to a pointer to the
textnode for the redline and map it back during export.

Regards
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-07-13 Thread Rosemary Sebastian
 include/xmloff/txtimp.hxx   |4 +-
 sw/source/filter/xml/XMLRedlineImportHelper.cxx |   44 
 sw/source/filter/xml/XMLRedlineImportHelper.hxx |3 +
 sw/source/filter/xml/xmltexti.cxx   |   13 ++-
 sw/source/filter/xml/xmltexti.hxx   |3 +
 xmloff/source/text/txtimp.cxx   |8 +++-
 xmloff/source/text/txtparai.cxx |5 ++
 xmloff/source/text/txtparai.hxx |3 +
 8 files changed, 75 insertions(+), 8 deletions(-)

New commits:
commit a6bc6c2b7138b7de5dcd45944eb5321fbd16d53b
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Wed Jul 13 13:53:30 2016 +0530

WIP Insert redline into document

Change-Id: I98857e98503176c812b0fb70a41cb8e79637da78

diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index 01045d0..01b3f0a 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -678,7 +678,9 @@ public:
 
 virtual bool CheckRedlineExists(
 /// ID used to RedlineAdd() call
-const OUString& rId);
+const OUString& rStartParaPos);
+
+virtual void InsertRedlinesWithinParagraph(const OUString& rStartParaPos, 
bool bStart, bool bIsOutsideOfParagraph);
 
 virtual void RedlineSetCursor(
 /// ID used to RedlineAdd() call
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 686d606..0767c50 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -503,6 +503,50 @@ bool XMLRedlineImportHelper::Check(
 return false;
 }
 
+void XMLRedlineImportHelper::InsertWithinParagraph(const OUString& rParaPos, 
bool bStart,
+Reference & rRange, bool bIsOutsideOfParagraph)
+{
+::std::map<OUString, RedlineInfo*>::iterator aFind = 
aRedlineMap[rParaPos].begin();
+for( ; aRedlineMap[rParaPos].end() != aFind; ++aFind )
+{
+// RedlineInfo found; now set Cursor
+RedlineInfo* pInfo = aFind->second;
+if (bIsOutsideOfParagraph)
+{
+// outside of paragraph: remember SwNodeIndex
+if (bStart)
+{
+pInfo->aAnchorStart.SetAsNodeIndex(rRange);
+}
+else
+{
+pInfo->aAnchorEnd.SetAsNodeIndex(rRange);
+}
+
+// also remember that we expect an adjustment for this redline
+pInfo->bNeedsAdjustment = true;
+}
+else
+{
+// inside of a paragraph: use regular XTextRanges (bookmarks)
+if (bStart)
+pInfo->aAnchorStart.Set(rRange);
+else
+pInfo->aAnchorEnd.Set(rRange);
+}
+
+// if this Cursor was the last missing info, we insert the
+// node into the document
+// then we can remove the entry from the map and destroy the object
+if (IsReady(pInfo))
+{
+InsertIntoDocument(pInfo);
+delete pInfo;
+}
+}
+aRedlineMap[rParaPos].clear();
+}
+
 void XMLRedlineImportHelper::SetCursor(
 const OUString& rParaPos,
 const OUString& rTextPos,
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.hxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
index af3f6c9..adb5695 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.hxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
@@ -86,6 +86,9 @@ public:
 bool Check(
 const OUString& rParaPos);
 
+void InsertWithinParagraph(const OUString& rParaPos, bool bStart,
+css::uno::Reference & rRange, bool 
bIsOusideOfParagraph);
+
 // Set start or end position for a redline in the text body.
 // Accepts XTextRange objects.
 void SetCursor(
diff --git a/sw/source/filter/xml/xmltexti.cxx 
b/sw/source/filter/xml/xmltexti.cxx
index 1c4b2c4..05c1cb6 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -1001,14 +1001,23 @@ uno::Reference 
SwXMLTextImportHelper::RedlineCreateText(
 }
 
 bool SwXMLTextImportHelper::CheckRedlineExists(
-const OUString& rId)
+const OUString& rStartParaPos)
 {
 if(pRedlineHelper != nullptr)
-return pRedlineHelper->Check(rId);
+return pRedlineHelper->Check(rStartParaPos);
 return false;
 // else: ignore redline (wasn't added before, else we'd have a helper)
 }
 
+void SwXMLTextImportHelper::InsertRedlinesWithinParagraph(const OUString& 
rStartParaPos, bool bStart, bool bIsOutsideOfParagraph)
+{
+if(pRedlineHelper != nullptr)
+{
+uno::Reference xTextRange( GetCursor()->getStart() );
+pRedlineHelper->InsertWithinParagraph(rStartParaPos, bStart, 
xTextRange, bIsOutsideOfParagraph);
+}
+}
+
 void SwXMLTextImportHelper::RedlineSetCursor(
 const OUString& rP

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-07-12 Thread Rosemary Sebastian
 include/xmloff/XMLTrackedChangesImportContext.hxx |   15 +++--
 include/xmloff/txtimp.hxx |   23 +---
 sw/source/filter/xml/XMLRedlineImportHelper.cxx   |   48 +-
 sw/source/filter/xml/XMLRedlineImportHelper.hxx   |   18 +++---
 sw/source/filter/xml/xmltexti.cxx |   26 +
 sw/source/filter/xml/xmltexti.hxx |9 +--
 xmloff/source/text/XMLChangeElementImportContext.cxx  |2 
 xmloff/source/text/XMLChangeImportContext.cxx |4 -
 xmloff/source/text/XMLTrackedChangesImportContext.cxx |   42 +--
 xmloff/source/text/txtimp.cxx |   43 +++-
 xmloff/source/text/txtparai.cxx   |7 ++
 11 files changed, 142 insertions(+), 95 deletions(-)

New commits:
commit 45675aed3b9c121266d78e37bccc00dbfbcda09b
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Wed Jul 13 06:28:30 2016 +0530

Access aRedlineMap when parsing content.xml

- Moved aRedlineMap to global scope.
- Made it two-dimensional with the first index indicating the paragraph
  index and the second indicating the text position within the paragraph.

Change-Id: I1c21040e258344c2c42e880fd30dc0efc3689815

diff --git a/include/xmloff/XMLTrackedChangesImportContext.hxx 
b/include/xmloff/XMLTrackedChangesImportContext.hxx
index f19052a..5737e95 100644
--- a/include/xmloff/XMLTrackedChangesImportContext.hxx
+++ b/include/xmloff/XMLTrackedChangesImportContext.hxx
@@ -57,13 +57,15 @@ public:
 /// redline date
 OUString sDate;
 
-/// redline date
-OUString sStart;
+/// redline start
+OUString sStartParaPos;
+OUString sStartTextPos;
 
-/// redline date
-OUString sEnd;
+/// redline end
+OUString sEndParaPos;
+OUString sEndTextPos;
 
-/// redline date
+/// redline type
 OUString sType;
 
 /// merge-last-paragraph flag
@@ -89,7 +91,8 @@ public:
const OUString& rAuthor,
const OUString& rComment,
const OUString& rDate,
-   const sal_uInt32);
+   const OUString& rStartParaPos,
+   const OUString& rStartTextPos);
 
 /// create redline XText/XTextCursor on demand and register with
 /// XMLTextImportHelper
diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index 12825dd..01045d0 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -390,7 +390,6 @@ private:
 static std::shared_ptr MakeBackpatcherImpl();
 
 sal_Int16nParaIdx = 0;
-bool bInsertRedline = false;
 protected:
 virtual SvXMLImportContext *CreateTableChildContext(
 SvXMLImport& rImport,
@@ -658,8 +657,6 @@ public:
 virtual void RedlineAdd(
 /// redline type (insert, del,... )
 const OUString& rType,
-/// use to identify this redline
-const OUString& rId,
 /// name of the author
 const OUString& rAuthor,
 /// redline comment
@@ -668,13 +665,16 @@ public:
 const css::util::DateTime& rDateTime,
 /// merge last paras
 bool bMergeLastParagraph,
-const sal_uInt32 nStartParaPos);
+/// start position
+const OUString& rStartParaPos,
+const OUString& rStartTextPos);
 
 virtual css::uno::Reference< css::text::XTextCursor> RedlineCreateText(
 /// needed to get the document
 css::uno::Reference< css::text::XTextCursor > & rOldCursor,
 /// ID used to RedlineAdd() call
-const OUString& rId);
+const OUString& rParaPos,
+const OUString& rTextPos);
 
 virtual bool CheckRedlineExists(
 /// ID used to RedlineAdd() call
@@ -682,7 +682,8 @@ public:
 
 virtual void RedlineSetCursor(
 /// ID used to RedlineAdd() call
-const OUString& rId,
+const OUString& rParaPos,
+const OUString& rTextPos,
 /// start or end Cursor
 bool bStart,
 /// range is not within 
@@ -695,11 +696,15 @@ public:
 const css::uno::Sequence & rProtectionKey );
 
 /// get the last open redline ID
-OUString GetOpenRedlineId();
+OUString GetOpenRedlineParaPos();
+/// get the last open redline ID
+OUString GetOpenRedlineTextPos();
+/// modify the last open redline ID
+void SetOpenRedlineParaPos( OUString const & rParaPos);
 /// modify the last open redline ID
-void SetOpenRedlineId( OUString const & rId);
+void SetOpenRedlineTextPos( OUString const & rTextPos);
 /// reset the last open redline ID
-void ResetOpenRedlineId();
+void ResetOpenRedlinePositions();
 
 /** redl

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-07-11 Thread Rosemary Sebastian
Rebased ref, commits from common ancestor:
commit 7b673a8524e43cfd2b445d386465d71d82e97dc5
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Jul 11 19:58:40 2016 +0530

WIP Insert redline into document

Change-Id: I477ef0dc0e62b83059dc5877746c16071a88507b

diff --git a/include/xmloff/XMLTrackedChangesImportContext.hxx 
b/include/xmloff/XMLTrackedChangesImportContext.hxx
index c3a4414..f19052a 100644
--- a/include/xmloff/XMLTrackedChangesImportContext.hxx
+++ b/include/xmloff/XMLTrackedChangesImportContext.hxx
@@ -57,6 +57,15 @@ public:
 /// redline date
 OUString sDate;
 
+/// redline date
+OUString sStart;
+
+/// redline date
+OUString sEnd;
+
+/// redline date
+OUString sType;
+
 /// merge-last-paragraph flag
 bool bMergeLastPara;
 
@@ -79,7 +88,8 @@ public:
 void SetChangeInfo(const OUString& rType,
const OUString& rAuthor,
const OUString& rComment,
-   const OUString& rDate);
+   const OUString& rDate,
+   const sal_uInt32);
 
 /// create redline XText/XTextCursor on demand and register with
 /// XMLTextImportHelper
diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index 92f2bf9..12825dd 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -389,6 +389,8 @@ private:
 std::shared_ptr m_xBackpatcherImpl;
 static std::shared_ptr MakeBackpatcherImpl();
 
+sal_Int16nParaIdx = 0;
+bool bInsertRedline = false;
 protected:
 virtual SvXMLImportContext *CreateTableChildContext(
 SvXMLImport& rImport,
@@ -665,7 +667,8 @@ public:
 /// date+time
 const css::util::DateTime& rDateTime,
 /// merge last paras
-bool bMergeLastParagraph);
+bool bMergeLastParagraph,
+const sal_uInt32 nStartParaPos);
 
 virtual css::uno::Reference< css::text::XTextCursor> RedlineCreateText(
 /// needed to get the document
@@ -673,6 +676,10 @@ public:
 /// ID used to RedlineAdd() call
 const OUString& rId);
 
+virtual bool CheckRedlineExists(
+/// ID used to RedlineAdd() call
+const OUString& rId);
+
 virtual void RedlineSetCursor(
 /// ID used to RedlineAdd() call
 const OUString& rId,
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 0952c46..7a8d992 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -195,6 +195,7 @@ public:
 OUString sComment;  // change comment string
 util::DateTime aDateTime;   // change DateTime
 bool bMergeLastParagraph;   // the SwRangeRedline::IsDelLastPara flag
+sal_uInt32 nStartParagraphPos;
 
 // each position can may be either empty, an XTextRange, or an SwNodeIndex
 
@@ -373,7 +374,8 @@ void XMLRedlineImportHelper::Add(
 const OUString& rAuthor,
 const OUString& rComment,
 const util::DateTime& rDateTime,
-bool bMergeLastPara)
+bool bMergeLastPara,
+const sal_uInt32 nStartParaPos)
 {
 // we need to do the following:
 // 1) parse type string
@@ -411,6 +413,7 @@ void XMLRedlineImportHelper::Add(
 pInfo->sComment = rComment;
 pInfo->aDateTime = rDateTime;
 pInfo->bMergeLastParagraph = bMergeLastPara;
+pInfo->nStartParagraphPos = nStartParaPos;
 
 // ad 3)
 if (aRedlineMap.end() == aRedlineMap.find(rId))
@@ -487,6 +490,17 @@ Reference 
XMLRedlineImportHelper::CreateRedlineTextSection(
 return xReturn;
 }
 
+bool XMLRedlineImportHelper::Check(
+const OUString& rId)
+{
+RedlineMapType::iterator aFind = aRedlineMap.find(rId);
+if (aRedlineMap.end() != aFind)
+{
+return true;
+}
+return false;
+}
+
 void XMLRedlineImportHelper::SetCursor(
 const OUString& rId,
 bool bStart,
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.hxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
index f78866b..240c36c 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.hxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
@@ -76,7 +76,8 @@ public:
 const OUString& rAuthor, // name of the author
 const OUString& rComment,// redline comment
 const css::util::DateTime& rDateTime, // date+time
-bool bMergeLastParagraph);  // merge last paragraph?
+bool bMergeLastParagraph,  // merge last paragraph?
+const sal_uInt32 nStartParaPos); // start paragraph position
 
 // create a text section for the redline, and return an
 // XText/XTextCursor that may be used to write into it.
@@ -84,6 +85,9 @@ public:
 css::uno::Reference xOldCursor, // needed 
to ge

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-07-11 Thread Rosemary Sebastian
 include/xmloff/XMLTrackedChangesImportContext.hxx |   12 ++-
 include/xmloff/txtimp.hxx |9 -
 sw/source/filter/xml/XMLRedlineImportHelper.cxx   |   22 ++---
 sw/source/filter/xml/XMLRedlineImportHelper.hxx   |6 +++
 sw/source/filter/xml/swxml.cxx|   14 
 sw/source/filter/xml/xmltexti.cxx |   14 +++-
 sw/source/filter/xml/xmltexti.hxx |5 ++-
 xmloff/source/text/XMLChangeInfoContext.cxx   |4 --
 xmloff/source/text/XMLChangedRegionImportContext.cxx  |   14 
 xmloff/source/text/XMLChangedRegionImportContext.hxx  |6 ---
 xmloff/source/text/XMLTrackedChangesImportContext.cxx |   30 +++---
 xmloff/source/text/txtimp.cxx |   13 ++-
 xmloff/source/text/txtparai.cxx   |9 -
 xmloff/source/text/txtparai.hxx   |4 +-
 14 files changed, 112 insertions(+), 50 deletions(-)

New commits:
commit 56043029a387283dba933ab94bdd454aaa74dcc6
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Mon Jul 11 19:58:40 2016 +0530

WIP Insert redline into document

Change-Id: I477ef0dc0e62b83059dc5877746c16071a88507b

diff --git a/include/xmloff/XMLTrackedChangesImportContext.hxx 
b/include/xmloff/XMLTrackedChangesImportContext.hxx
index c3a4414..f19052a 100644
--- a/include/xmloff/XMLTrackedChangesImportContext.hxx
+++ b/include/xmloff/XMLTrackedChangesImportContext.hxx
@@ -57,6 +57,15 @@ public:
 /// redline date
 OUString sDate;
 
+/// redline date
+OUString sStart;
+
+/// redline date
+OUString sEnd;
+
+/// redline date
+OUString sType;
+
 /// merge-last-paragraph flag
 bool bMergeLastPara;
 
@@ -79,7 +88,8 @@ public:
 void SetChangeInfo(const OUString& rType,
const OUString& rAuthor,
const OUString& rComment,
-   const OUString& rDate);
+   const OUString& rDate,
+   const sal_uInt32);
 
 /// create redline XText/XTextCursor on demand and register with
 /// XMLTextImportHelper
diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index 92f2bf9..12825dd 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -389,6 +389,8 @@ private:
 std::shared_ptr m_xBackpatcherImpl;
 static std::shared_ptr MakeBackpatcherImpl();
 
+sal_Int16nParaIdx = 0;
+bool bInsertRedline = false;
 protected:
 virtual SvXMLImportContext *CreateTableChildContext(
 SvXMLImport& rImport,
@@ -665,7 +667,8 @@ public:
 /// date+time
 const css::util::DateTime& rDateTime,
 /// merge last paras
-bool bMergeLastParagraph);
+bool bMergeLastParagraph,
+const sal_uInt32 nStartParaPos);
 
 virtual css::uno::Reference< css::text::XTextCursor> RedlineCreateText(
 /// needed to get the document
@@ -673,6 +676,10 @@ public:
 /// ID used to RedlineAdd() call
 const OUString& rId);
 
+virtual bool CheckRedlineExists(
+/// ID used to RedlineAdd() call
+const OUString& rId);
+
 virtual void RedlineSetCursor(
 /// ID used to RedlineAdd() call
 const OUString& rId,
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 0952c46..9bd69be 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -195,6 +195,7 @@ public:
 OUString sComment;  // change comment string
 util::DateTime aDateTime;   // change DateTime
 bool bMergeLastParagraph;   // the SwRangeRedline::IsDelLastPara flag
+sal_uInt32 nStartParagraphPos;
 
 // each position can may be either empty, an XTextRange, or an SwNodeIndex
 
@@ -319,9 +320,9 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
   "now deleted");
 }
 }
-delete pInfo;
-}
-aRedlineMap.clear();
+ delete pInfo;
+ }
+ aRedlineMap.clear();
 
 // set redline mode, either to info property set, or directly to
 // the document
@@ -373,7 +374,8 @@ void XMLRedlineImportHelper::Add(
 const OUString& rAuthor,
 const OUString& rComment,
 const util::DateTime& rDateTime,
-bool bMergeLastPara)
+bool bMergeLastPara,
+const sal_uInt32 nStartParaPos)
 {
 // we need to do the following:
 // 1) parse type string
@@ -411,6 +413,7 @@ void XMLRedlineImportHelper::Add(
 pInfo->sComment = rComment;
 pInfo->aDateTime = rDateTime;
 pInfo->bMergeLastParagraph = bMergeLastPara;
+pInfo->nStartParagraphPos = nStartParaPos;
 
 // ad 

GSoC Week 6 Report

2016-07-05 Thread Rosemary Sebastian
Hello everyone

This week I've been working on the import of the text insertion and
deletion changes.

There is an issue while referring to a change since in writer the elements
exist as a hierarchical structure of nodes whereas according to the MCT
proposal we need to number the paragraphs as well as the characters within
the paragraphs to refer to a change. I'll be looking at it next.

Regards
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - sw/inc

2016-07-02 Thread Rosemary Sebastian
 dev/null   |binary
 sw/inc/redline.hxx |3 +--
 2 files changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 6ef8bbca51c3774596794a6f52aaab29e532c57e
Author: Rosemary Sebastian <rosemary.s...@gmail.com>
Date:   Sat Jul 2 18:56:55 2016 +0530

Clean up code

Change-Id: I637e99315a43a9542988062bdde88f3e033ca8a4

diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 2ebe5cc..fc9fe34a 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -168,8 +168,7 @@ public:
 pNext->CanCombine( *rCmp.pNext ))) &&
 (( !pExtraData && !rCmp.pExtraData ) ||
 ( pExtraData && rCmp.pExtraData &&
-*pExtraData == *rCmp.pExtraData )) &&
-nUndoEnd == rCmp.nUndoStart - 1;
+*pExtraData == *rCmp.pExtraData ));
 }
 
 // ExtraData gets copied, the pointer is therefore not taken over by
diff --git a/sw/inc/redline.hxx.gch b/sw/inc/redline.hxx.gch
deleted file mode 100644
index 1fac9bb..000
Binary files a/sw/inc/redline.hxx.gch and /dev/null differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


GSoC Week 5 Report

2016-06-29 Thread Rosemary Sebastian
Hello everyone

This week I got the export of addition and deletion of text and paragraph
working. There is still the pending problem of getting the positions of the
changes after all the changes have been applied to the document. Next I'll
be working on the import filter.

Regards
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/inc sw/source xmloff/source

2016-06-25 Thread Rosemary Sebastian
 include/xmloff/txtparae.hxx |   29 +
 sw/inc/redline.hxx  |6 -
 sw/inc/redline.hxx.gch  |binary
 sw/source/core/unocore/unoredline.cxx   |6 +++--
 xmloff/source/text/XMLRedlineExport.cxx |   37 +---
 xmloff/source/text/XMLRedlineExport.hxx |8 +++---
 xmloff/source/text/txtparae.cxx |   13 ++-
 7 files changed, 66 insertions(+), 33 deletions(-)

New commits:
commit 39816f01c52176d6a262e7684ab9535d9f0ebb61
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sat Jun 25 10:55:35 2016 +0530

Get text positions with changes applied

Change-Id: I5ceaad492380d00e55c84cfcf0d66a7c3f4cf9c1

diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index 92fae21..fd13ff1 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -93,6 +93,8 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public 
XMLStyleExport
 /// may be NULL (if no redlines should be exported; e.g. in block mode)
 XMLRedlineExport*pRedlineExport;
 sal_uInt32  nParaIdx;
+sal_uInt32  nParaDelCount;
+sal_uInt32  nTextDelCount;
 
 boolbProgress;
 
@@ -249,7 +251,7 @@ public:
 
 void exportUndoTextRangeEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & rRangeEnum,
-const sal_uInt32& rParaIdx,
+sal_uInt32 nParagraphIdx,
 bool bAutoStyles );
 void exportTextRangeEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & rRangeEnum,
@@ -304,7 +306,7 @@ protected:
 TextPNS eExtensionNS = TextPNS::ODF);
 void exportUndoParagraph(
 const css::uno::Reference< css::text::XTextContent > & rTextContent,
-const sal_uInt32& rParaIdx,
+sal_uInt32 nParaIdx,
 bool bAutoStyles, bool bProgress,
 MultiPropertySetHelper& rPropSetHelper);
 void exportParagraph(
@@ -542,9 +544,9 @@ public:
 void exportTitleAndDescription( const css::uno::Reference< 
css::beans::XPropertySet > & rPropSet,
 const css::uno::Reference< 
css::beans::XPropertySetInfo > & rPropSetInfo );
 
-void setParaIdx(sal_uInt32 rParaIdx)
+void setParaIdx(sal_uInt32 nParagraphIdx)
 {
-nParaIdx = rParaIdx;
+nParaIdx = nParagraphIdx;
 }
 
 sal_uInt32 getParaIdx()
@@ -552,6 +554,25 @@ public:
 return nParaIdx;
 }
 
+void setTextDelCount(sal_uInt32 nTextDeleteCount )
+{
+nTextDelCount = nTextDeleteCount;
+}
+
+sal_uInt32 getTextDelCount()
+{
+return nTextDelCount;
+}
+
+void setParaDelCount(sal_uInt32 nParagraphDelCount)
+{
+nParaDelCount = nParagraphDelCount;
+}
+
+sal_uInt32 getParaDelCount()
+{
+return nParaDelCount;
+}
 // This method exports the given XText
 void exportTrackedChanges(
 const css::uno::Reference< css::text::XText > & rText,
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 5588b94..2ebe5cc 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -114,6 +114,7 @@ class SW_DLLPUBLIC SwRedlineData
 DateTime aStamp;
 RedlineType_t eType;
 sal_uInt16 nAuthor, nSeqNo;
+OUString sUndoType;
 
 public:
 SwRedlineData( RedlineType_t eT, sal_uInt16 nAut );
@@ -151,6 +152,7 @@ public:
 void SetComment( const OUString& rS ) { sComment = rS; }
 void SetUndoStart( const sal_uInt32& rUndoStart ) { nUndoStart = 
rUndoStart; }
 void SetUndoEnd( const sal_uInt32& rUndoEnd ) { nUndoEnd = rUndoEnd; }
+void SetUndoType( const OUString& rUndoType )   { sUndoType = 
rUndoType; }
 void SetTimeStamp( const DateTime& rDT ) { aStamp = rDT; }
 
 void SetAutoFormatFlag()
@@ -166,7 +168,8 @@ public:
 pNext->CanCombine( *rCmp.pNext ))) &&
 (( !pExtraData && !rCmp.pExtraData ) ||
 ( pExtraData && rCmp.pExtraData &&
-*pExtraData == *rCmp.pExtraData ));
+*pExtraData == *rCmp.pExtraData )) &&
+nUndoEnd == rCmp.nUndoStart - 1;
 }
 
 // ExtraData gets copied, the pointer is therefore not taken over by
@@ -247,6 +250,7 @@ public:
 
 void SetUndoStart( const sal_uInt32& rUndoStart ) { 
pRedlineData->SetUndoStart( rUndoStart ); }
 void SetUndoEnd( const sal_uInt32& rUndoEnd ) { pRedlineData->SetUndoEnd( 
rUndoEnd ); }
+void SetUndoType( const OUString& rUndoType ) { pRedlineData->SetUndoType( 
rUndoType ); }
 void SetComment( const OUString& rS ) { pRedlineData->SetComment( rS ); }
 
 /** ExtraData gets

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-06-23 Thread Rosemary Sebastian
 include/xmloff/txtparae.hxx|   31 -
 sw/source/filter/xml/xmlexp.cxx|2 
 sw/source/filter/xml/xmlfmte.cxx   |3 
 xmloff/source/text/XMLRedlineExport.cxx|  418 -
 xmloff/source/text/XMLRedlineExport.hxx|   43 --
 xmloff/source/text/XMLTextMasterPageExport.cxx |1 
 xmloff/source/text/txtparae.cxx|  370 --
 7 files changed, 19 insertions(+), 849 deletions(-)

New commits:
commit 1668fda4bfd7d2681b440497da2ab37f45cf47b8
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Thu Jun 23 09:56:09 2016 +0530

Clean up code

Change-Id: Ib44e072f42620a9b17e813996a4ea817cb280da4

diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index ce851f8..92fae21 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -250,8 +250,7 @@ public:
 void exportUndoTextRangeEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & rRangeEnum,
 const sal_uInt32& rParaIdx,
-bool bAutoStyles, bool bProgress,
-bool bPrvChrIsSpc = true );
+bool bAutoStyles );
 void exportTextRangeEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & rRangeEnum,
 bool bAutoStyles, bool bProgress,
@@ -277,7 +276,7 @@ protected:
 void exportUndoText(
 const css::uno::Reference <
 css::text::XText > & rText,
-bool bAutoStyles, bool bProgress, bool bExportParagraph, TextPNS 
eExtensionNS = TextPNS::ODF );
+bool bAutoStyles, bool bProgress );
 
 void exportText(
 const css::uno::Reference <
@@ -293,11 +292,7 @@ protected:
 const css::uno::Reference< css::container::XEnumeration > & 
rContentEnum,
 bool bAutoStyles,
 const css::uno::Reference< css::text::XTextSection > & rBaseSection,
-bool bProgress,
-bool bExportParagraph = true,
-const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet = 
nullptr,
-bool bExportLevels = true,
-TextPNS eExtensionNS = TextPNS::ODF);
+bool bProgress);
 bool exportTextContentEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & 
rContentEnum,
 bool bAutoStyles,
@@ -311,9 +306,7 @@ protected:
 const css::uno::Reference< css::text::XTextContent > & rTextContent,
 const sal_uInt32& rParaIdx,
 bool bAutoStyles, bool bProgress,
-bool bExportParagraph,
-MultiPropertySetHelper& rPropSetHelper,
-TextPNS eExtensionNS = TextPNS::ODF);
+MultiPropertySetHelper& rPropSetHelper);
 void exportParagraph(
 const css::uno::Reference< css::text::XTextContent > & rTextContent,
 bool bAutoStyles, bool bProgress,
@@ -498,15 +491,6 @@ public:
 /// export all declarations
 void exportUsedDeclarations();
 
-/// Export the list of change information (enclosed by )
-/// (or the necessary automatic styles)
-void exportTrackedChanges(bool bAutoStyle);
-
-/// Export the list of change information (enclosed by )
-/// (or the necessary automatic styles)
-void exportTrackedChanges(const css::uno::Reference< css::text::XText > & 
rText,
-  bool bAutoStyle );
-
 /// Record tracked changes for this particular XText
 /// (empty reference stop recording)
 /// This should be used if tracked changes for e.g. footers are to
@@ -569,12 +553,11 @@ public:
 }
 
 // This method exports the given XText
-void exportUndoText(
+void exportTrackedChanges(
 const css::uno::Reference< css::text::XText > & rText,
-bool bIsProgress = false,
-bool bExportParagraph = true, TextPNS eExtensionNS = TextPNS::ODF)
+bool bIsProgress = false)
 {
-exportUndoText( rText, false, bIsProgress, bExportParagraph, 
eExtensionNS );
+exportUndoText( rText, false, bIsProgress );
 }
 
 void exportText(
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 2812ec5..f9f2d40 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -497,7 +497,7 @@ void SwXMLExport::ExportUndo_()
 true, true );
 Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
 Reference < XText > xText = xTextDoc->getText();
-GetTextParagraphExport()->exportUndoText( xText, bShowProgress );
+GetTextParagraphExport()->exportTrackedChanges( xText, bShowProgress );
 }
 
 namespace
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 312b8b2..5247201 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -201,9 +201,6 @@ v

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - xmloff/source

2016-06-22 Thread Rosemary Sebastian
 xmloff/source/text/XMLRedlineExport.cxx |   90 
 xmloff/source/text/txtparae.cxx |3 -
 2 files changed, 46 insertions(+), 47 deletions(-)

New commits:
commit b4d0ec6e524cd9024d24c398cd911e1565e7495e
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Wed Jun 22 21:17:59 2016 +0530

Fix insertion of text and paragraph

Change-Id: I19488bf89e119fbdd5124e14cbc7aa27990321fc

diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index aaf776b..f4f270b 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -342,51 +342,48 @@ void XMLRedlineExport::ExportChangesListAutoStyles()
 void XMLRedlineExport::ExportUndoChangeInline(
 const Reference & rPropSet, const sal_uInt32& rParaIdx)
 {
-// determine element name (depending on collapsed, start/end)
 {
+Any aAny = rPropSet->getPropertyValue(sRedlineType);
+OUString sType;
+aAny >>= sType;
+
+sal_uInt32 nParagraphIdx = rParaIdx, nCharStart, nCharEnd;
+rPropSet->getPropertyValue(sRedlineUndoStart) >>= nCharStart;
+rPropSet->getPropertyValue(sRedlineUndoEnd) >>= nCharEnd;
+
+XMLTokenEnum eUndoType = XML_TEXT;
+OUString sUndoType;
+aAny = rPropSet->getPropertyValue(sRedlineUndoType);
+aAny >>= sUndoType;
+
+if( sUndoType == "paragraph" )
 {
-Any aAny;
-aAny = rPropSet->getPropertyValue(sRedlineType);
-OUString sType;
-aAny >>= sType;
-
-sal_uInt32 nParagraphIdx = rParaIdx, nCharStart, nCharEnd;
-rPropSet->getPropertyValue(sRedlineUndoStart) >>= nCharStart;
-rPropSet->getPropertyValue(sRedlineUndoEnd) >>= nCharEnd;
-if(sType == sDelete)
-nParagraphIdx++;
-
-XMLTokenEnum eUndoType = XML_PARAGRAPH;
-OUString sUndoType;
-aAny = rPropSet->getPropertyValue(sRedlineUndoType);
-aAny >>= sUndoType;
-
-if( sUndoType == "text" )
-eUndoType = XML_TEXT;
-if(eUndoType == XML_PARAGRAPH)
-{
-rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
rtl::OUString::number(nParagraphIdx));
-rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, 
XML_PARAGRAPH);
-}
-else
-{
-rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
rtl::OUString::number(nParagraphIdx) + "/" + rtl::OUString::number(nCharStart));
-if( sType == sInsert || sType == sFormat )
-rExport.AddAttribute(XML_NAMESPACE_C, XML_END, "/" + 
rtl::OUString::number(nParagraphIdx) + "/" + rtl::OUString::number(nCharEnd));
-rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, eUndoType);
-}
-SvXMLElementExport aChange(rExport, XML_NAMESPACE_TEXT,
-ConvertTypeName(sType), true, true);
-
-// get XText from the redline and export (if the XText exists)
-aAny = rPropSet->getPropertyValue(sRedlineText);
-Reference xText;
-aAny >>= xText;
-if (xText.is())
-{
-rExport.GetTextParagraphExport()->exportText(xText);
-// default parameters: bProgress, bExportParagraph ???
-}
+eUndoType = XML_PARAGRAPH;
+nParagraphIdx++;
+}
+if(eUndoType == XML_PARAGRAPH)
+{
+rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
rtl::OUString::number(nParagraphIdx));
+rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, XML_PARAGRAPH);
+}
+else
+{
+rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
rtl::OUString::number(nParagraphIdx) + "/" + rtl::OUString::number(nCharStart));
+if( sType == sInsert || sType == sFormat )
+rExport.AddAttribute(XML_NAMESPACE_C, XML_END, "/" + 
rtl::OUString::number(nParagraphIdx) + "/" + rtl::OUString::number(nCharEnd));
+rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, eUndoType);
+}
+SvXMLElementExport aChange(rExport, XML_NAMESPACE_TEXT,
+ConvertTypeName(sType), true, true);
+
+// get XText from the redline and export (if the XText exists)
+aAny = rPropSet->getPropertyValue(sRedlineText);
+Reference xText;
+aAny >>= xText;
+if (xText.is())
+{
+rExport.GetTextParagraphExport()->exportText(xText);
+// default parameters: bProgress, bExportParagraph ???
 }

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-06-22 Thread Rosemary Sebastian
 include/xmloff/txtparae.hxx |   45 ++
 sw/source/core/unocore/unomapproperties.hxx |4 
 sw/source/filter/xml/xmlexp.cxx |4 
 xmloff/source/text/XMLRedlineExport.cxx |  132 ++
 xmloff/source/text/XMLRedlineExport.hxx |   17 
 xmloff/source/text/txtparae.cxx |  552 +++-
 6 files changed, 741 insertions(+), 13 deletions(-)

New commits:
commit 79651457952e910786474c9751178077ca121c06
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Wed Jun 22 14:37:36 2016 +0530

Implement export of insertion and deletion changes

Change-Id: I6a8b580dc43c744bb181961ff26c95acd10207cb

diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index 5e445bd..ce851f8 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -92,6 +92,7 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public 
XMLStyleExport
 
 /// may be NULL (if no redlines should be exported; e.g. in block mode)
 XMLRedlineExport*pRedlineExport;
+sal_uInt32  nParaIdx;
 
 boolbProgress;
 
@@ -246,6 +247,11 @@ public:
 const css::uno::Reference< css::beans::XPropertyState > & rPropState,
 const css::uno::Reference< css::beans::XPropertySetInfo > & 
rPropSetInfo );
 
+void exportUndoTextRangeEnumeration(
+const css::uno::Reference< css::container::XEnumeration > & rRangeEnum,
+const sal_uInt32& rParaIdx,
+bool bAutoStyles, bool bProgress,
+bool bPrvChrIsSpc = true );
 void exportTextRangeEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & rRangeEnum,
 bool bAutoStyles, bool bProgress,
@@ -268,6 +274,11 @@ protected:
 
 void exportNumStyles( bool bUsed );
 
+void exportUndoText(
+const css::uno::Reference <
+css::text::XText > & rText,
+bool bAutoStyles, bool bProgress, bool bExportParagraph, TextPNS 
eExtensionNS = TextPNS::ODF );
+
 void exportText(
 const css::uno::Reference <
 css::text::XText > & rText,
@@ -278,6 +289,15 @@ protected:
 const css::uno::Reference< css::text::XTextSection > & rBaseSection,
 bool bAutoStyles, bool bProgress, bool bExportParagraph, TextPNS 
eExtensionNS = TextPNS::ODF );
 
+bool exportUndoTextContentEnumeration(
+const css::uno::Reference< css::container::XEnumeration > & 
rContentEnum,
+bool bAutoStyles,
+const css::uno::Reference< css::text::XTextSection > & rBaseSection,
+bool bProgress,
+bool bExportParagraph = true,
+const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet = 
nullptr,
+bool bExportLevels = true,
+TextPNS eExtensionNS = TextPNS::ODF);
 bool exportTextContentEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & 
rContentEnum,
 bool bAutoStyles,
@@ -287,6 +307,13 @@ protected:
 const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet = 
nullptr,
 bool bExportLevels = true,
 TextPNS eExtensionNS = TextPNS::ODF);
+void exportUndoParagraph(
+const css::uno::Reference< css::text::XTextContent > & rTextContent,
+const sal_uInt32& rParaIdx,
+bool bAutoStyles, bool bProgress,
+bool bExportParagraph,
+MultiPropertySetHelper& rPropSetHelper,
+TextPNS eExtensionNS = TextPNS::ODF);
 void exportParagraph(
 const css::uno::Reference< css::text::XTextContent > & rTextContent,
 bool bAutoStyles, bool bProgress,
@@ -531,7 +558,25 @@ public:
 void exportTitleAndDescription( const css::uno::Reference< 
css::beans::XPropertySet > & rPropSet,
 const css::uno::Reference< 
css::beans::XPropertySetInfo > & rPropSetInfo );
 
+void setParaIdx(sal_uInt32 rParaIdx)
+{
+nParaIdx = rParaIdx;
+}
+
+sal_uInt32 getParaIdx()
+{
+return nParaIdx;
+}
+
 // This method exports the given XText
+void exportUndoText(
+const css::uno::Reference< css::text::XText > & rText,
+bool bIsProgress = false,
+bool bExportParagraph = true, TextPNS eExtensionNS = TextPNS::ODF)
+{
+exportUndoText( rText, false, bIsProgress, bExportParagraph, 
eExtensionNS );
+}
+
 void exportText(
 const css::uno::Reference< css::text::XText > & rText,
 bool bIsProgress = false,
diff --git a/sw/source/core/unocore/unomapproperties.hxx 
b/sw/source/core/unocore/unomapproperties.hxx
index e10b7d8..8edcb3b 100644
--- a/sw/source/core/unocore/unomapproperties.hxx
+++ b/sw/source/core/unocore/unomapproperties.hxx
@@ -74,8 +74,8 @@
 {OUString(UNO_NA

GSoC Week 4 Report

2016-06-20 Thread Rosemary Sebastian
Hello everyone

This week I implemented the export of the start and the end positions of a
redline within a paragraph and based on this, also the change type, i.e.,
"text" or "paragraph".
Currently I'm trying to make sure that paragraph styles such as outline
level are also exported.during addition or deletion of a paragraph. I also
need to look into the boundary cases while exporting the change type.

Regards
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff xmloff/source

2016-06-18 Thread Rosemary Sebastian
Rebased ref, commits from common ancestor:
commit 376d7744306dc1f01d50bd7d436adc41b5405f9a
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sat Jun 18 23:58:20 2016 +0530

No need to mention the type for format changes

Change-Id: Idf59881cda5338d44c73702cfb55ce49df781075

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index af2e5dd..425580d 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -863,7 +863,6 @@ namespace xmloff { namespace token {
 XML_FORCE_MANUAL,
 XML_FOREGROUND,
 XML_FOREIGN_OBJECT,
-XML_FORMAT,
 XML_FORMAT_CHANGE,
 XML_FORMAT_SOURCE,
 XML_FORMATTING_ENTRY,
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index b81d544..1d30c0f 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -865,7 +865,6 @@ namespace xmloff { namespace token {
 TOKEN( "force-manual",XML_FORCE_MANUAL ),
 TOKEN( "foreground",  XML_FOREGROUND ),
 TOKEN( "foreign-object",  XML_FOREIGN_OBJECT ),
-TOKEN( "format",  XML_FORMAT ),
 TOKEN( "format-change",   XML_FORMAT_CHANGE ),
 TOKEN( "format-source",   XML_FORMAT_SOURCE ),
 TOKEN( "formatting-entry",XML_FORMATTING_ENTRY ),
diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index 1ed7bde..4226e4a 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -348,9 +348,7 @@ void XMLRedlineExport::ExportChangedRegion(
 aAny = rPropSet->getPropertyValue(sRedlineUndoType);
 aAny >>= sUndoType;
 
-if( sType == sFormat )
-eUndoType = XML_FORMAT;
-else if( sUndoType == "text" )
+if( sUndoType == "text" )
 eUndoType = XML_TEXT;
 if(eUndoType == XML_PARAGRAPH)
 {
@@ -362,7 +360,8 @@ void XMLRedlineExport::ExportChangedRegion(
 rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
rtl::OUString::number(nParagraphIdx) + "/" + rtl::OUString::number(nCharStart));
 if( sType == sInsert || sType == sFormat )
 rExport.AddAttribute(XML_NAMESPACE_C, XML_END, "/" + 
rtl::OUString::number(nParagraphIdx) + "/" + rtl::OUString::number(nCharEnd));
-rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, eUndoType);
+if( sType != sFormat )
+rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, XML_TEXT);
 }
 SvXMLElementExport aChange(rExport, XML_NAMESPACE_TEXT,
ConvertTypeName(sType), true, true);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff xmloff/source

2016-06-18 Thread Rosemary Sebastian
 include/xmloff/xmltoken.hxx |1 -
 xmloff/source/core/xmltoken.cxx |1 -
 xmloff/source/text/XMLRedlineExport.cxx |4 +---
 3 files changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 82b4ee91ffbdbc59c5f4954647ed931c18a7b149
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sat Jun 18 23:58:20 2016 +0530

No need to mention the type for format changes

Change-Id: Idf59881cda5338d44c73702cfb55ce49df781075

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index af2e5dd..425580d 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -863,7 +863,6 @@ namespace xmloff { namespace token {
 XML_FORCE_MANUAL,
 XML_FOREGROUND,
 XML_FOREIGN_OBJECT,
-XML_FORMAT,
 XML_FORMAT_CHANGE,
 XML_FORMAT_SOURCE,
 XML_FORMATTING_ENTRY,
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index b81d544..1d30c0f 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -865,7 +865,6 @@ namespace xmloff { namespace token {
 TOKEN( "force-manual",XML_FORCE_MANUAL ),
 TOKEN( "foreground",  XML_FOREGROUND ),
 TOKEN( "foreign-object",  XML_FOREIGN_OBJECT ),
-TOKEN( "format",  XML_FORMAT ),
 TOKEN( "format-change",   XML_FORMAT_CHANGE ),
 TOKEN( "format-source",   XML_FORMAT_SOURCE ),
 TOKEN( "formatting-entry",XML_FORMATTING_ENTRY ),
diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index 1ed7bde..1801d34 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -348,9 +348,7 @@ void XMLRedlineExport::ExportChangedRegion(
 aAny = rPropSet->getPropertyValue(sRedlineUndoType);
 aAny >>= sUndoType;
 
-if( sType == sFormat )
-eUndoType = XML_FORMAT;
-else if( sUndoType == "text" )
+if( sUndoType == "text" )
 eUndoType = XML_TEXT;
 if(eUndoType == XML_PARAGRAPH)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/inc sw/source xmloff/source

2016-06-18 Thread Rosemary Sebastian
 include/xmloff/xmltoken.hxx |1 +
 sw/inc/redline.hxx  |8 
 sw/inc/unoprnms.hxx |2 +-
 sw/source/core/doc/docredln.cxx |   10 ++
 sw/source/core/text/redlnitr.cxx|2 ++
 sw/source/core/unocore/unoredline.cxx   |   14 +-
 xmloff/source/core/xmltoken.cxx |1 +
 xmloff/source/text/XMLRedlineExport.cxx |   26 ++
 xmloff/source/text/XMLRedlineExport.hxx |1 -
 9 files changed, 46 insertions(+), 19 deletions(-)

New commits:
commit 0e2e4319c5fd3232dbe09bb8fc18e2e48263643b
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sat Jun 18 23:30:17 2016 +0530

Get the correct start and end positions

Change-Id: I01db8d1556f8518e430e782d56a7310b1475dcb9

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 425580d..af2e5dd 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -863,6 +863,7 @@ namespace xmloff { namespace token {
 XML_FORCE_MANUAL,
 XML_FOREGROUND,
 XML_FOREIGN_OBJECT,
+XML_FORMAT,
 XML_FORMAT_CHANGE,
 XML_FORMAT_SOURCE,
 XML_FORMATTING_ENTRY,
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 1033a56..5588b94 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -109,6 +109,8 @@ class SW_DLLPUBLIC SwRedlineData
 SwRedlineExtraData* pExtraData;
 
 OUString sComment;
+sal_uInt32 nUndoStart;
+sal_uInt32 nUndoEnd;
 DateTime aStamp;
 RedlineType_t eType;
 sal_uInt16 nAuthor, nSeqNo;
@@ -147,6 +149,8 @@ public:
 inline const SwRedlineData* Next() const{ return pNext; }
 
 void SetComment( const OUString& rS ) { sComment = rS; }
+void SetUndoStart( const sal_uInt32& rUndoStart ) { nUndoStart = 
rUndoStart; }
+void SetUndoEnd( const sal_uInt32& rUndoEnd ) { nUndoEnd = rUndoEnd; }
 void SetTimeStamp( const DateTime& rDT ) { aStamp = rDT; }
 
 void SetAutoFormatFlag()
@@ -237,8 +241,12 @@ public:
 RedlineType_t GetRealType( sal_uInt16 nPos = 0 ) const;
 RedlineType_t GetType( sal_uInt16 nPos = 0) const
 { return ( (RedlineType_t)(GetRealType( nPos ) & 
nsRedlineType_t::REDLINE_NO_FLAG_MASK)); }
+const sal_uInt32& GetUndoStart( sal_uInt16 nPos = 0 ) const;
+const sal_uInt32& GetUndoEnd( sal_uInt16 nPos = 0 ) const;
 const OUString& GetComment( sal_uInt16 nPos = 0 ) const;
 
+void SetUndoStart( const sal_uInt32& rUndoStart ) { 
pRedlineData->SetUndoStart( rUndoStart ); }
+void SetUndoEnd( const sal_uInt32& rUndoEnd ) { pRedlineData->SetUndoEnd( 
rUndoEnd ); }
 void SetComment( const OUString& rS ) { pRedlineData->SetComment( rS ); }
 
 /** ExtraData gets copied, the pointer is therefore not taken over by
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 83b0a7a..7ada27e 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -542,7 +542,7 @@
 #define UNO_NAME_IS_IN_HEADER_FOOTER "IsInHeaderFooter"
 #define UNO_NAME_REDLINE_UNDO_START "RedlineUndoStart"
 #define UNO_NAME_REDLINE_UNDO_END "RedlineUndoEnd"
-#define UNO_NAME_REDLINE_ELEMENT_TYPE "RedlineElementType"
+#define UNO_NAME_REDLINE_UNDO_TYPE "RedlineUndoType"
 #define UNO_NAME_START_REDLINE "StartRedline"
 #define UNO_NAME_END_REDLINE "EndRedline"
 #define UNO_NAME_REDLINE_START "RedlineStart"
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 1f9e8ef..eee8ec6 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1546,6 +1546,16 @@ const OUString& SwRangeRedline::GetComment( sal_uInt16 
nPos ) const
 return GetRedlineData(nPos).sComment;
 }
 
+const sal_uInt32& SwRangeRedline::GetUndoStart( sal_uInt16 nPos ) const
+{
+return GetRedlineData(nPos).nUndoStart;
+}
+
+const sal_uInt32& SwRangeRedline::GetUndoEnd( sal_uInt16 nPos ) const
+{
+return GetRedlineData(nPos).nUndoEnd;
+}
+
 bool SwRangeRedline::operator<( const SwRangeRedline& rCmp ) const
 {
 if (*Start() < *rCmp.Start())
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index cb4df81..f5609d3 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -228,6 +228,8 @@ short SwRedlineItr::Seek_(SwFont& rFnt, sal_Int32 nNew, 
sal_Int32 nOld)
 for( ; nAct < 
(sal_Int32)rDoc.getIDocumentRedlineAccess().GetRedlineTable().size() ; ++nAct )
 {
 rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ nAct 
]->CalcStartEnd( nNdIdx, nStart, nEnd );
+rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ nAct 
]->SetUndoStart(nStart + 1);
+rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ nAct 
]->SetUndoEnd(nEnd);
 
 if( nN

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - sw/source xmloff/source

2016-06-17 Thread Rosemary Sebastian
 sw/source/core/unocore/unoredline.cxx   |   12 
 xmloff/source/text/XMLRedlineExport.cxx |2 +-
 2 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 70c230c10ad6ba678c00cf5b61235e7c261c7393
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Fri Jun 17 20:24:52 2016 +0530

Prevent crash

This is not the correct way to find the element type.
Hardcode the element type as "text" for now, to see the character
start and end positions in the resulting xml.

Change-Id: I254769ee922d6ecfd593e590293ee964878b0d0f

diff --git a/sw/source/core/unocore/unoredline.cxx 
b/sw/source/core/unocore/unoredline.cxx
index 37743a0..b83a3ee 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -311,11 +311,7 @@ uno::Any  SwXRedlinePortion::GetPropertyValue( const 
OUString& rPropertyName, co
 }
 else if (rPropertyName == UNO_NAME_REDLINE_ELEMENT_TYPE)
 {
-SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
-if ( 2 < ( pNodeIdx->GetNode().EndOfSectionIndex() - 
pNodeIdx->GetNode().GetIndex() ) )
-aRet <<= OUString("paragraph");
-else
-aRet <<= OUString("text");
+aRet <<= OUString("text");
 }
 else if (rPropertyName == UNO_NAME_REDLINE_UNDO_START)
 {
@@ -323,7 +319,7 @@ uno::Any  SwXRedlinePortion::GetPropertyValue( const 
OUString& rPropertyName, co
 }
 else if (rPropertyName == UNO_NAME_REDLINE_UNDO_END)
 {
-aRet <<= rRedline.GetPoint()->nContent.GetNext()->GetIndex();
+aRet <<= rRedline.GetPoint()->nContent.GetIndex();
 }
 return aRet;
 }
@@ -357,13 +353,13 @@ uno::Sequence< beans::PropertyValue > 
SwXRedlinePortion::CreateRedlineProperties
 pRet[nPropIdx++].Value <<= !rRedline.IsDelLastPara();
 
 pRet[nPropIdx].Name = UNO_NAME_REDLINE_ELEMENT_TYPE;
-pRet[nPropIdx++].Value <<= OUString("paragraph");
+pRet[nPropIdx++].Value <<= OUString("text");
 
 pRet[nPropIdx].Name = UNO_NAME_REDLINE_UNDO_START;
 pRet[nPropIdx++].Value <<= rRedline.GetPoint()->nContent.GetIndex() + 1;
 
 pRet[nPropIdx].Name = UNO_NAME_REDLINE_UNDO_END;
-pRet[nPropIdx++].Value <<= rRedline.GetMark()->nContent.GetIndex() + 1;
+pRet[nPropIdx++].Value <<= rRedline.GetPoint()->nContent.GetIndex() + 1;
 
 SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
 if(pNodeIdx )
diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index 8459764..6d44992 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -341,7 +341,7 @@ void XMLRedlineExport::ExportChangedRegion(
 rPropSet->getPropertyValue("RedlineUndoStart") >>= nCharStart;
 rPropSet->getPropertyValue("RedlineUndoEnd") >>= nCharEnd;
 
-XMLTokenEnum eElementType = XML_PARAGRAPH;
+XMLTokenEnum eElementType = XML_TEXT;
 OUString sElementType;
 aAny = rPropSet->getPropertyValue(sRedlineElementType);
 aAny >>= sElementType;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - sw/source xmloff/source

2016-06-17 Thread Rosemary Sebastian
 sw/source/core/unocore/unoredline.cxx   |   24 
 xmloff/source/text/XMLRedlineExport.cxx |2 +-
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit ef1380d84b36bf0f8d8bb5b77c2eabe4a0d04f61
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Fri Jun 17 19:32:04 2016 +0530

Get the start position of redline

Change-Id: I3fd5674b47e33f769cbb22203ab92444a1bb8d47

diff --git a/sw/source/core/unocore/unoredline.cxx 
b/sw/source/core/unocore/unoredline.cxx
index 0f8d115..37743a0 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -317,15 +317,13 @@ uno::Any  SwXRedlinePortion::GetPropertyValue( const 
OUString& rPropertyName, co
 else
 aRet <<= OUString("text");
 }
-else if (rPropertyName == UNO_NAME_REDLINE_UNDO_START || rPropertyName == 
UNO_NAME_REDLINE_UNDO_END)
+else if (rPropertyName == UNO_NAME_REDLINE_UNDO_START)
 {
-sal_Int32 nStart, nEnd;
-   SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
-   rRedline.CalcStartEnd(pNodeIdx->GetNode().GetIndex(), nStart, nEnd);
-   if(rPropertyName == UNO_NAME_REDLINE_UNDO_START)
-   aRet <<= nStart;
-   else
-   aRet <<= nEnd;
+aRet <<= rRedline.GetPoint()->nContent.GetIndex() + 1;
+}
+else if (rPropertyName == UNO_NAME_REDLINE_UNDO_END)
+{
+aRet <<= rRedline.GetPoint()->nContent.GetNext()->GetIndex();
 }
 return aRet;
 }
@@ -361,6 +359,12 @@ uno::Sequence< beans::PropertyValue > 
SwXRedlinePortion::CreateRedlineProperties
 pRet[nPropIdx].Name = UNO_NAME_REDLINE_ELEMENT_TYPE;
 pRet[nPropIdx++].Value <<= OUString("paragraph");
 
+pRet[nPropIdx].Name = UNO_NAME_REDLINE_UNDO_START;
+pRet[nPropIdx++].Value <<= rRedline.GetPoint()->nContent.GetIndex() + 1;
+
+pRet[nPropIdx].Name = UNO_NAME_REDLINE_UNDO_END;
+pRet[nPropIdx++].Value <<= rRedline.GetMark()->nContent.GetIndex() + 1;
+
 SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
 if(pNodeIdx )
 {
@@ -369,10 +373,6 @@ uno::Sequence< beans::PropertyValue > 
SwXRedlinePortion::CreateRedlineProperties
 uno::Reference xRet = new 
SwXRedlineText(rRedline.GetDoc(), *pNodeIdx);
 pRet[nPropIdx].Name = UNO_NAME_REDLINE_TEXT;
 pRet[nPropIdx++].Value <<= xRet;
-pRet[nPropIdx].Name = UNO_NAME_REDLINE_UNDO_START;
-pRet[nPropIdx++].Value <<= pNodeIdx->GetNode().GetIndex();
-pRet[nPropIdx].Name = UNO_NAME_REDLINE_UNDO_END;
-pRet[nPropIdx++].Value <<= pNodeIdx->GetNode().EndOfSectionIndex();
 }
 else {
 OSL_FAIL("Empty section in redline portion! (end node immediately 
follows start node)");
diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index 1d085b8..8459764 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -337,7 +337,7 @@ void XMLRedlineExport::ExportChangedRegion(
 OUString sType;
 aAny >>= sType;
 
-sal_Int16 nParagraphIdx = 2, nCharStart, nCharEnd;
+sal_uInt32 nParagraphIdx = 2, nCharStart, nCharEnd;
 rPropSet->getPropertyValue("RedlineUndoStart") >>= nCharStart;
 rPropSet->getPropertyValue("RedlineUndoEnd") >>= nCharEnd;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - 2 commits - sw/inc sw/source xmloff/source

2016-06-16 Thread Rosemary Sebastian
 sw/inc/unoprnms.hxx |5 +++--
 sw/source/core/unocore/unomapproperties.hxx |4 ++--
 sw/source/core/unocore/unoredline.cxx   |   25 +
 xmloff/source/text/XMLRedlineExport.cxx |   26 +++---
 xmloff/source/text/XMLRedlineExport.hxx |1 +
 xmloff/source/text/txtparae.cxx |5 -
 6 files changed, 50 insertions(+), 16 deletions(-)

New commits:
commit edd64d4304cdf6f18af08e573d0fa952391c7552
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Fri Jun 17 01:41:44 2016 +0530

WIP Get change-tracking information

Change-Id: I33982d37ec6b04c1325be5f03455df35d9eaaebe

diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 3683ab4..83b0a7a 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -540,8 +540,8 @@
 #define UNO_NAME_REDLINE_SUCCESSOR_DATA "RedlineSuccessorData"
 #define UNO_NAME_REDLINE_IDENTIFIER "RedlineIdentifier"
 #define UNO_NAME_IS_IN_HEADER_FOOTER "IsInHeaderFooter"
-#define UNO_NAME_START "Start"
-#define UNO_NAME_END "End"
+#define UNO_NAME_REDLINE_UNDO_START "RedlineUndoStart"
+#define UNO_NAME_REDLINE_UNDO_END "RedlineUndoEnd"
 #define UNO_NAME_REDLINE_ELEMENT_TYPE "RedlineElementType"
 #define UNO_NAME_START_REDLINE "StartRedline"
 #define UNO_NAME_END_REDLINE "EndRedline"
diff --git a/sw/source/core/unocore/unomapproperties.hxx 
b/sw/source/core/unocore/unomapproperties.hxx
index bc2851f..e10b7d8 100644
--- a/sw/source/core/unocore/unomapproperties.hxx
+++ b/sw/source/core/unocore/unomapproperties.hxx
@@ -74,8 +74,8 @@
 {OUString(UNO_NAME_IS_IN_HEADER_FOOTER), 0, cppu::UnoType::get(),
 
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\
 {OUString(UNO_NAME_REDLINE_TEXT), 0, 
cppu::UnoType::get(),
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY,   0},\
 {OUString(UNO_NAME_MERGE_LAST_PARA), 0, cppu::UnoType::get(),
 PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 
0},\
-{OUString(UNO_NAME_START), 0, cppu::UnoType::get(),  
   PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\
-{OUString(UNO_NAME_END), 0, cppu::UnoType::get(),
   PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},
+{OUString(UNO_NAME_REDLINE_UNDO_START), 0, cppu::UnoType::get(), 

PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\
+{OUString(UNO_NAME_REDLINE_UNDO_END), 0, cppu::UnoType::get(),   

PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},
 #define COMMON_CRSR_PARA_PROPERTIES_FN_ONLY \
 { OUString(UNO_NAME_PARA_STYLE_NAME), FN_UNO_PARA_STYLE,
cppu::UnoType::get(),PropertyAttribute::MAYBEVOID,
 0},   \
 { OUString(UNO_NAME_PAGE_STYLE_NAME), FN_UNO_PAGE_STYLE,
cppu::UnoType::get(), 
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY,   0}, 
  \
diff --git a/sw/source/core/unocore/unoredline.cxx 
b/sw/source/core/unocore/unoredline.cxx
index 3a93bed..0f8d115 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -311,13 +311,18 @@ uno::Any  SwXRedlinePortion::GetPropertyValue( const 
OUString& rPropertyName, co
 }
 else if (rPropertyName == UNO_NAME_REDLINE_ELEMENT_TYPE)
 {
-OUString sElementType = "paragraph";
-aRet <<= sElementType;
+SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
+if ( 2 < ( pNodeIdx->GetNode().EndOfSectionIndex() - 
pNodeIdx->GetNode().GetIndex() ) )
+aRet <<= OUString("paragraph");
+else
+aRet <<= OUString("text");
 }
-else if (rPropertyName == UNO_NAME_START || rPropertyName == UNO_NAME_END)
+else if (rPropertyName == UNO_NAME_REDLINE_UNDO_START || rPropertyName == 
UNO_NAME_REDLINE_UNDO_END)
 {
-   sal_Int32 nStart(COMPLETE_STRING), nEnd(COMPLETE_STRING);
-   if(rPropertyName == UNO_NAME_START)
+sal_Int32 nStart, nEnd;
+   SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
+   rRedline.CalcStartEnd(pNodeIdx->GetNode().GetIndex(), nStart, nEnd);
+   if(rPropertyName == UNO_NAME_REDLINE_UNDO_START)
aRet <<= nStart;
else
aRet <<= nEnd;
@@ -328,7 +333,7 @@ uno::Any  SwXRedlinePortion::GetPropertyValue( const 
OUString& rPropertyName, co
 uno::Sequence< beans::PropertyValue > 
SwXRedlinePortion::CreateRedlineProperties(
 const SwRangeRedline& rRedline, bool bIsStart ) throw()
 {
-uno::Sequence< beans::PropertyValue >

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - sw/source xmloff/source

2016-06-16 Thread Rosemary Sebastian
 sw/source/core/unocore/unoredline.cxx   |2 --
 xmloff/source/text/XMLRedlineExport.cxx |   12 ++--
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 8554bcbecdeeb709554712a711d75d69e4b5ec6e
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Thu Jun 16 16:49:17 2016 +0530

WIP Get start and end positions of redline

Change-Id: I23550fb065eb36fd1be91826397e5d9d0034b0c7

diff --git a/sw/source/core/unocore/unoredline.cxx 
b/sw/source/core/unocore/unoredline.cxx
index 896da83..367cd9a 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -311,9 +311,7 @@ uno::Any  SwXRedlinePortion::GetPropertyValue( const 
OUString& rPropertyName, co
 }
 else if (rPropertyName == UNO_NAME_START || rPropertyName == UNO_NAME_END)
 {
-  SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
sal_Int32 nStart(COMPLETE_STRING), nEnd(COMPLETE_STRING);
-   rRedline.CalcStartEnd(pNodeIdx->GetNode().GetIndex(), nStart, nEnd);
if(rPropertyName == UNO_NAME_START)
aRet <<= nStart;
else
diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index b4451fd..1e3ad9f 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -335,19 +335,19 @@ void XMLRedlineExport::ExportChangedRegion(
 OUString sType;
 aAny >>= sType;
 XMLTokenEnum eChangeType = XML_PARAGRAPH;
-OUString sParagraphIdx = "2", sCharStart, sCharEnd;
-rPropSet->getPropertyValue("Start") >>= sCharStart;
-rPropSet->getPropertyValue("End") >>= sCharEnd;
+sal_uInt16 nParagraphIdx = 2, nCharStart, nCharEnd;
+rPropSet->getPropertyValue("Start") >>= nCharStart;
+rPropSet->getPropertyValue("End") >>= nCharEnd;
 if(eChangeType == XML_PARAGRAPH)
 {
-rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
sParagraphIdx);
+rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
rtl::OUString::number(nParagraphIdx));
 rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, XML_PARAGRAPH);
 }
 else
 {
-rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
sParagraphIdx + "/" + sCharStart);
+rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
rtl::OUString::number(nParagraphIdx) + "/" + rtl::OUString::number(nCharStart));
 if( sType == sInsert )
-rExport.AddAttribute(XML_NAMESPACE_C, XML_END, "/" + 
sParagraphIdx + "/" + sCharEnd);
+rExport.AddAttribute(XML_NAMESPACE_C, XML_END, "/" + 
rtl::OUString::number(nParagraphIdx) + "/" + rtl::OUString::number(nCharEnd));
 rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, eChangeType);
 }
 SvXMLElementExport aChange(rExport, XML_NAMESPACE_TEXT,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - xmloff/source

2016-06-15 Thread Rosemary Sebastian
 xmloff/source/text/XMLRedlineExport.cxx |   35 
 xmloff/source/text/XMLRedlineExport.hxx |5 
 2 files changed, 40 deletions(-)

New commits:
commit 7b2d588fa7dd162c132103500774b278fc149e80
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Thu Jun 16 09:19:51 2016 +0530

No need to export changes inline

Change-Id: I11340715aa40fa490339e03c09509d334dc289dd

diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index daa0f0b..b4451fd 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -115,10 +115,6 @@ void XMLRedlineExport::ExportChange(
 if (pCurrentChangesList != nullptr)
 ExportChangeAutoStyle(rPropSet);
 }
-else
-{
-ExportChangeInline(rPropSet);
-}
 }
 
 
@@ -324,37 +320,6 @@ void XMLRedlineExport::ExportChangesListAutoStyles()
 }
 }
 
-void XMLRedlineExport::ExportChangeInline(
-const Reference & rPropSet)
-{
-// determine element name (depending on collapsed, start/end)
-enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
-Any aAny = rPropSet->getPropertyValue(sIsCollapsed);
-bool bCollapsed = *static_cast(aAny.getValue());
-if (bCollapsed)
-{
-eElement = XML_CHANGE;
-}
-else
-{
-aAny = rPropSet->getPropertyValue(sIsStart);
-const bool bStart = *static_cast(aAny.getValue());
-eElement = bStart ? XML_CHANGE_START : XML_CHANGE_END;
-}
-
-if (XML_TOKEN_INVALID != eElement)
-{
-// we always need the ID
-rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_CHANGE_ID,
- GetRedlineID(rPropSet));
-
-// export the element (no whitespace because we're in the text body)
-SvXMLElementExport aChangeElem(rExport, XML_NAMESPACE_TEXT,
-   eElement, false, false);
-}
-}
-
-
 void XMLRedlineExport::ExportChangedRegion(
 const Reference & rPropSet)
 {
diff --git a/xmloff/source/text/XMLRedlineExport.hxx 
b/xmloff/source/text/XMLRedlineExport.hxx
index 08e8973..1ece917 100644
--- a/xmloff/source/text/XMLRedlineExport.hxx
+++ b/xmloff/source/text/XMLRedlineExport.hxx
@@ -146,11 +146,6 @@ public:
 
 private:
 
-/// export the change mark contained in the text body
-void ExportChangeInline(
-/// PropertySet of RedlinePortion
-const css::uno::Reference & rPropSet);
-
 /// export the auto styles used in this change
 void ExportChangeAutoStyle(
 /// PropertySet of RedlinePortion
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - xmloff/source

2016-06-15 Thread Rosemary Sebastian
 xmloff/source/text/XMLRedlineExport.cxx |   22 ++
 1 file changed, 18 insertions(+), 4 deletions(-)

New commits:
commit d24e473475b93f5c512a831570fa9c14f40ec0bf
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Wed Jun 15 23:32:49 2016 +0530

WIP Implement more types of changes

Change-Id: I2d7878bc5e328f63b5f1e17a3cb787d6aebdcc8c

diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index 70883ec..daa0f0b 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -366,11 +366,25 @@ void XMLRedlineExport::ExportChangedRegion(
 
 // scope for (first) change element
 {
-rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "2");
-rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, XML_PARAGRAPH);
 aAny = rPropSet->getPropertyValue(sRedlineType);
 OUString sType;
 aAny >>= sType;
+XMLTokenEnum eChangeType = XML_PARAGRAPH;
+OUString sParagraphIdx = "2", sCharStart, sCharEnd;
+rPropSet->getPropertyValue("Start") >>= sCharStart;
+rPropSet->getPropertyValue("End") >>= sCharEnd;
+if(eChangeType == XML_PARAGRAPH)
+{
+rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
sParagraphIdx);
+rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, XML_PARAGRAPH);
+}
+else
+{
+rExport.AddAttribute(XML_NAMESPACE_C, XML_START, "/" + 
sParagraphIdx + "/" + sCharStart);
+if( sType == sInsert )
+rExport.AddAttribute(XML_NAMESPACE_C, XML_END, "/" + 
sParagraphIdx + "/" + sCharEnd);
+rExport.AddAttribute(XML_NAMESPACE_DC, XML_TYPE, eChangeType);
+}
 SvXMLElementExport aChange(rExport, XML_NAMESPACE_TEXT,
ConvertTypeName(sType), true, true);
 
@@ -418,11 +432,11 @@ const OUString XMLRedlineExport::ConvertTypeName(
 {
 if (sApiName == sDelete)
 {
-return sDeletion;
+return sInsertion;
 }
 else if (sApiName == sInsert)
 {
-return sInsertion;
+return sDeletion;
 }
 else if (sApiName == sFormat)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


GSoC Week 3 Report

2016-06-15 Thread Rosemary Sebastian
Hello everyone

This week I reworked the placeholder XML a bit, and started looking at the
UNO implementation of redlines. Currently I'm working on defining new
redline properties to get the necessary change-tracking information.

Regards
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - sw/inc sw/source

2016-06-15 Thread Rosemary Sebastian
 sw/inc/unoprnms.hxx |2 ++
 sw/source/core/unocore/unomapproperties.hxx |5 +++--
 sw/source/core/unocore/unoredline.cxx   |   10 ++
 3 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit db2c79d70c5c464ecd794db57f4961df27791997
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Wed Jun 15 12:17:42 2016 +0530

Create "Start" and "End" properties for redline

Change-Id: I2c5a69948af9b80334e84f45382f290c9bfcad1a

diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 63589f2..c3e9853 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -540,6 +540,8 @@
 #define UNO_NAME_REDLINE_SUCCESSOR_DATA "RedlineSuccessorData"
 #define UNO_NAME_REDLINE_IDENTIFIER "RedlineIdentifier"
 #define UNO_NAME_IS_IN_HEADER_FOOTER "IsInHeaderFooter"
+#define UNO_NAME_START "Start"
+#define UNO_NAME_END "End"
 #define UNO_NAME_START_REDLINE "StartRedline"
 #define UNO_NAME_END_REDLINE "EndRedline"
 #define UNO_NAME_REDLINE_START "RedlineStart"
diff --git a/sw/source/core/unocore/unomapproperties.hxx 
b/sw/source/core/unocore/unomapproperties.hxx
index 1f528f0..bc2851f 100644
--- a/sw/source/core/unocore/unomapproperties.hxx
+++ b/sw/source/core/unocore/unomapproperties.hxx
@@ -73,8 +73,9 @@
 {OUString(UNO_NAME_REDLINE_IDENTIFIER), 0, cppu::UnoType::get(), 

PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\
 {OUString(UNO_NAME_IS_IN_HEADER_FOOTER), 0, cppu::UnoType::get(),
 
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\
 {OUString(UNO_NAME_REDLINE_TEXT), 0, 
cppu::UnoType::get(),
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY,   0},\
-{OUString(UNO_NAME_MERGE_LAST_PARA), 0, cppu::UnoType::get(),
 PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 
0},
-
+{OUString(UNO_NAME_MERGE_LAST_PARA), 0, cppu::UnoType::get(),
 PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 
0},\
+{OUString(UNO_NAME_START), 0, cppu::UnoType::get(),  
   PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\
+{OUString(UNO_NAME_END), 0, cppu::UnoType::get(),
   PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},
 #define COMMON_CRSR_PARA_PROPERTIES_FN_ONLY \
 { OUString(UNO_NAME_PARA_STYLE_NAME), FN_UNO_PARA_STYLE,
cppu::UnoType::get(),PropertyAttribute::MAYBEVOID,
 0},   \
 { OUString(UNO_NAME_PAGE_STYLE_NAME), FN_UNO_PAGE_STYLE,
cppu::UnoType::get(), 
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY,   0}, 
  \
diff --git a/sw/source/core/unocore/unoredline.cxx 
b/sw/source/core/unocore/unoredline.cxx
index 20b9f4c..896da83 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -309,6 +309,16 @@ uno::Any  SwXRedlinePortion::GetPropertyValue( const 
OUString& rPropertyName, co
 {
 aRet <<= !rRedline.IsDelLastPara();
 }
+else if (rPropertyName == UNO_NAME_START || rPropertyName == UNO_NAME_END)
+{
+  SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
+   sal_Int32 nStart(COMPLETE_STRING), nEnd(COMPLETE_STRING);
+   rRedline.CalcStartEnd(pNodeIdx->GetNode().GetIndex(), nStart, nEnd);
+   if(rPropertyName == UNO_NAME_START)
+   aRet <<= nStart;
+   else
+   aRet <<= nEnd;
+}
 return aRet;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-06-14 Thread Rosemary Sebastian
 include/xmloff/xmlnmspe.hxx |   15 +++---
 include/xmloff/xmltoken.hxx |2 
 sw/source/filter/xml/xmlexp.cxx |4 -
 xmloff/source/core/xmlexp.cxx   |3 -
 xmloff/source/core/xmltoken.cxx |2 
 xmloff/source/text/XMLRedlineExport.cxx |   74 
 6 files changed, 18 insertions(+), 82 deletions(-)

New commits:
commit baf57f89f63d24aa4592ed52c6cc9236fcde6635
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Tue Jun 14 21:59:32 2016 +0530

Rework the placeholder XML

Change-Id: I54d813588910bc2ea324873c8b41977e7ad6340c

diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx
index ae588d2..e0cf19d 100644
--- a/include/xmloff/xmlnmspe.hxx
+++ b/include/xmloff/xmlnmspe.hxx
@@ -70,6 +70,7 @@ XML_NAMESPACE( REPORT,  33U )
 XML_NAMESPACE( OF,  34U )   // OpenFormula aka ODFF
 XML_NAMESPACE( XHTML,   35U )
 XML_NAMESPACE( GRDDL,   36U )
+XML_NAMESPACE( C,   37U )
 
 // namespaces for odf extended formats
 
@@ -77,14 +78,14 @@ XML_NAMESPACE( GRDDL,   36U )
 const sal_uInt16 XML_NAMESPACE_##prefix##_EXT   = key; \
 const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX   = key;
 
-XML_NAMESPACE_EXT( OFFICE,  37U )
-XML_NAMESPACE_EXT( TABLE,   38U )
-XML_NAMESPACE_EXT( CHART,   39U )
-XML_NAMESPACE_EXT( DRAW,40U )
-XML_NAMESPACE_EXT( CALC,41U )
-XML_NAMESPACE_EXT( LO,  42U )
+XML_NAMESPACE_EXT( OFFICE,  38U )
+XML_NAMESPACE_EXT( TABLE,   39U )
+XML_NAMESPACE_EXT( CHART,   40U )
+XML_NAMESPACE_EXT( DRAW,41U )
+XML_NAMESPACE_EXT( CALC,42U )
+XML_NAMESPACE_EXT( LO,  43U )
 
-#define XML_OLD_NAMESPACE_BASE 43U
+#define XML_OLD_NAMESPACE_BASE 44U
 
 // namespaces used in the technical preview (SO 5.2)
 XML_OLD_NAMESPACE( FO,  0U )
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 4ddc061..425580d 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -99,6 +99,8 @@ namespace xmloff { namespace token {
 XML_N_XLINK_OLD,
 XML_NP_DC,
 XML_N_DC,
+XML_NP_C,
+XML_N_C,
 XML_NP_SVG,
 XML_N_SVG,
 XML_NP_FORM,
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 4213eb5..75e2cd0 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -572,7 +572,7 @@ 
com_sun_star_comp_Writer_XMLUndoExporter_get_implementation(css::uno::XComponent
 css::uno::Sequence const &)
 {
 return cppu::acquire(new SwXMLExport(context, 
OUString("com.sun.star.comp.Writer.XMLUndoExporter"),
-SvXMLExportFlags::UNDO | SvXMLExportFlags::AUTOSTYLES));
+SvXMLExportFlags::UNDO));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
@@ -622,7 +622,7 @@ 
com_sun_star_comp_Writer_XMLOasisUndoExporter_get_implementation(css::uno::XComp
 css::uno::Sequence const &)
 {
 return cppu::acquire(new SwXMLExport(context, 
OUString("com.sun.star.comp.Writer.XMLOasisUndoExporter"),
-SvXMLExportFlags::UNDO | SvXMLExportFlags::AUTOSTYLES | 
SvXMLExportFlags::OASIS));
+SvXMLExportFlags::UNDO | SvXMLExportFlags::OASIS));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 059bbd0..f2b20df 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -333,7 +333,7 @@ void SvXMLExport::InitCtor_()
 }
 
 // namespaces for documents
-if( getExportFlags() & 
(SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT)
 )
+if( getExportFlags() & 
(SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT|
 SvXMLExportFlags::UNDO) )
 {
 mpNamespaceMap->Add( GetXMLToken(XML_NP_DC),GetXMLToken(XML_N_DC), 
 XML_NAMESPACE_DC );
 mpNamespaceMap->Add( GetXMLToken(XML_NP_TEXT),  
GetXMLToken(XML_N_TEXT),XML_NAMESPACE_TEXT );
@@ -347,6 +347,7 @@ void SvXMLExport::InitCtor_()
 mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOW),  
GetXMLToken(XML_N_OOOW),XML_NAMESPACE_OOOW );
 mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOC),  
GetXMLToken(XML_N_OOOC),XML_NAMESPACE_OOOC );
 mpNamespaceMap->Add( GetXMLToken(XML_NP_OF),GetXMLToken(XML_N_OF), 
 XML_NAMESPACE_OF );
+mpNamespaceMap->Add( GetXMLToken(XML_NP_C), GetXMLToken(XML_N_C),  
 XML_NAMESPACE_C );
 
 if (getDefaultVersion() > SvtSaveOptions::ODFVER_012)
 {
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 50920fd..1d30c0f 100644
--- a/xmloff/source/core/xmltoken.cxx
+++

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - xmloff/source

2016-06-12 Thread Rosemary Sebastian
 xmloff/source/text/XMLRedlineExport.cxx |   19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit b345d1acaa19e7be250cc6c9cbc5b6bc4d6aff2a
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Mon Jun 13 00:10:48 2016 +0530

Remove all TODO's

Change-Id: I8bdd2e54c31158858782045e7d4a86bb46927773

diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index f2dc166..abb3467 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -490,7 +490,7 @@ void XMLRedlineExport::ExportChangeInfo(
 aAny = rPropSet->getPropertyValue(sRedlineType);
 OUString sType;
 aAny >>= sType;
-if(sType == sFormat) // TODO: Find out if the style is inserted or deleted 
to give the proper namespace
+if(sType == sFormat)
 {
 {
 SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
@@ -500,17 +500,17 @@ void XMLRedlineExport::ExportChangeInfo(
 {
 SvXMLElementExport aNameElem( rExport, XML_NAMESPACE_DC,
 XML_NAME, true, false );
-rExport.Characters("bold"); // TODO: Get the correct style name
+rExport.Characters("bold");
 }
 {
 SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DC,
 XML_START, true, false );
-rExport.Characters("/"); // TODO: Get the correct start position
+rExport.Characters("/");
 }
 {
 SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DC,
 XML_END, true, false );
-rExport.Characters("/"); // TODO: Get the correct end position
+rExport.Characters("/");
 }
 }
 else if(sType == sInsert)
@@ -518,12 +518,12 @@ void XMLRedlineExport::ExportChangeInfo(
 {
 SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
 XML_TYPE, true, false );
-rExport.Characters("text"); // or paragraph TODO: Find a way to 
distinguish text and paragraph changes
+rExport.Characters("text");
 }
 {
 SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DC,
 XML_START, true, false );
-rExport.Characters("/"); // TODO: Get the correct start position 
(NumberingLevel for paragraph)
+rExport.Characters("/");
 }
 {
 SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DC,
@@ -535,19 +535,18 @@ void XMLRedlineExport::ExportChangeInfo(
 {
 SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
 XML_TYPE, true, false );
-rExport.Characters("paragraph"); // or text TODO: Find a way to 
distinguish text and paragraph changes
+rExport.Characters("paragraph");
 }
 {
 SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DC,
 XML_START, true, false );
 OUString paraPos = "2";
-rExport.Characters("/" + paraPos); // TODO: Get the correct start 
position
+rExport.Characters("/" + paraPos);
 }
 {
 SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DC,
 XML_END, true, false );
-// TODO: Check if type is not paragraph
-rExport.Characters("/"); // TODO: Get the correct end position
+rExport.Characters("/");
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - xmloff/source

2016-06-11 Thread Rosemary Sebastian
 xmloff/source/text/XMLRedlineExport.cxx |   81 
 1 file changed, 51 insertions(+), 30 deletions(-)

New commits:
commit 094bbdcabc961e82de7534c5dfa7fa56df658a28
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sun Jun 12 08:24:17 2016 +0530

The xml should not be nested

Change-Id: I8470808c7ac12fd8d61427cd2fadaa1dd13758ca

diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index ab1885f..f2dc166 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -492,42 +492,63 @@ void XMLRedlineExport::ExportChangeInfo(
 aAny >>= sType;
 if(sType == sFormat) // TODO: Find out if the style is inserted or deleted 
to give the proper namespace
 {
-SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
-  XML_TYPE, true, false );
-rExport.Characters("style");
-SvXMLElementExport aNameElem( rExport, XML_NAMESPACE_DC,
-  XML_NAME, true, false );
-rExport.Characters("bold"); // TODO: Get the correct style name
-SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DC,
-  XML_START, true, false );
-rExport.Characters("start"); // TODO: Get the correct start position
-SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DC,
-  XML_END, true, false );
-rExport.Characters("end"); // TODO: Get the correct end position
+{
+SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
+XML_TYPE, true, false );
+rExport.Characters("style");
+}
+{
+SvXMLElementExport aNameElem( rExport, XML_NAMESPACE_DC,
+XML_NAME, true, false );
+rExport.Characters("bold"); // TODO: Get the correct style name
+}
+{
+SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DC,
+XML_START, true, false );
+rExport.Characters("/"); // TODO: Get the correct start position
+}
+{
+SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DC,
+XML_END, true, false );
+rExport.Characters("/"); // TODO: Get the correct end position
+}
 }
 else if(sType == sInsert)
 {
-SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
-  XML_TYPE, true, false );
-rExport.Characters("text"); // or paragraph TODO: Find a way to 
distinguish text and paragraph changes
-SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DC,
-  XML_START, true, false );
-rExport.Characters("start"); // TODO: Get the correct start position 
(NumberingLevel for paragraph)
-SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DC,
-  XML_END, true, false );
+{
+SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
+XML_TYPE, true, false );
+rExport.Characters("text"); // or paragraph TODO: Find a way to 
distinguish text and paragraph changes
+}
+{
+SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DC,
+XML_START, true, false );
+rExport.Characters("/"); // TODO: Get the correct start position 
(NumberingLevel for paragraph)
+}
+{
+SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DC,
+XML_END, true, false );
+}
 }
 else if(sType == sDelete)
 {
-SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
-  XML_TYPE, true, false );
-rExport.Characters("text"); // or paragraph TODO: Find a way to 
distinguish text and paragraph changes
-SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DC,
-  XML_START, true, false );
-rExport.Characters("start"); // TODO: Get the correct start position
-SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DC,
-  XML_END, true, false );
-// TODO: Check if type is not paragraph
-rExport.Characters("end"); // TODO: Get the correct end position
+{
+SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
+XML_TYPE, true, false );
+rExpor

GSoC Week 2 Report

2016-06-07 Thread Rosemary Sebastian
Hello everyone

This week I've written some placeholder XML for exporting the tracked
changes.
Currently I'm trying to export change-tracking information such as start
and end positions of a redline, paragraph number, etc.

Thanks
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - 2 commits - include/xmloff xmloff/source

2016-06-07 Thread Rosemary Sebastian
 include/xmloff/xmlnmspe.hxx |   16 +++-
 xmloff/source/text/XMLRedlineExport.cxx |   32 
 2 files changed, 35 insertions(+), 13 deletions(-)

New commits:
commit 3edd0d2e3591461af647e08f281c296923c8944d
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Tue Jun 7 16:36:18 2016 +0530

Add placeholder xml to store tracked changes

Change-Id: I53ad233faa7d148c6d5dbcb1c301b31f5110ced0

diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index 7853056..ab1885f 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -505,6 +505,30 @@ void XMLRedlineExport::ExportChangeInfo(
   XML_END, true, false );
 rExport.Characters("end"); // TODO: Get the correct end position
 }
+else if(sType == sInsert)
+{
+SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
+  XML_TYPE, true, false );
+rExport.Characters("text"); // or paragraph TODO: Find a way to 
distinguish text and paragraph changes
+SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DC,
+  XML_START, true, false );
+rExport.Characters("start"); // TODO: Get the correct start position 
(NumberingLevel for paragraph)
+SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DC,
+  XML_END, true, false );
+}
+else if(sType == sDelete)
+{
+SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
+  XML_TYPE, true, false );
+rExport.Characters("text"); // or paragraph TODO: Find a way to 
distinguish text and paragraph changes
+SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DC,
+  XML_START, true, false );
+rExport.Characters("start"); // TODO: Get the correct start position
+SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DC,
+  XML_END, true, false );
+// TODO: Check if type is not paragraph
+rExport.Characters("end"); // TODO: Get the correct end position
+}
 
 // comment as  sequence
 aAny = rPropSet->getPropertyValue(sRedlineComment);
commit 9ee00a7db3412f13f70034e168d0b7fa8201f519
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Tue Jun 7 16:34:49 2016 +0530

New namespace is not currently of interest

Change-Id: I00f45f4f29f81128c80390acb3899a26cb3d2237

diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx
index da467d1..ae588d2 100644
--- a/include/xmloff/xmlnmspe.hxx
+++ b/include/xmloff/xmlnmspe.hxx
@@ -70,8 +70,6 @@ XML_NAMESPACE( REPORT,  33U )
 XML_NAMESPACE( OF,  34U )   // OpenFormula aka ODFF
 XML_NAMESPACE( XHTML,   35U )
 XML_NAMESPACE( GRDDL,   36U )
-XML_NAMESPACE( ADD, 37U )
-XML_NAMESPACE( DEL, 38U )
 
 // namespaces for odf extended formats
 
@@ -79,14 +77,14 @@ XML_NAMESPACE( DEL, 38U )
 const sal_uInt16 XML_NAMESPACE_##prefix##_EXT   = key; \
 const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX   = key;
 
-XML_NAMESPACE_EXT( OFFICE,  39U )
-XML_NAMESPACE_EXT( TABLE,   40U )
-XML_NAMESPACE_EXT( CHART,   41U )
-XML_NAMESPACE_EXT( DRAW,42U )
-XML_NAMESPACE_EXT( CALC,43U )
-XML_NAMESPACE_EXT( LO,  44U )
+XML_NAMESPACE_EXT( OFFICE,  37U )
+XML_NAMESPACE_EXT( TABLE,   38U )
+XML_NAMESPACE_EXT( CHART,   39U )
+XML_NAMESPACE_EXT( DRAW,40U )
+XML_NAMESPACE_EXT( CALC,41U )
+XML_NAMESPACE_EXT( LO,  42U )
 
-#define XML_OLD_NAMESPACE_BASE 45U
+#define XML_OLD_NAMESPACE_BASE 43U
 
 // namespaces used in the technical preview (SO 5.2)
 XML_OLD_NAMESPACE( FO,  0U )
diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index c59fae5..7853056 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -492,16 +492,16 @@ void XMLRedlineExport::ExportChangeInfo(
 aAny >>= sType;
 if(sType == sFormat) // TODO: Find out if the style is inserted or deleted 
to give the proper namespace
 {
-SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DEL,
+SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DC,
   XML_TYPE, true, false );
 rExport.Characters("style");
-SvXMLElementExport aNameElem( rExport, XML_NAMESPACE_DEL,
+SvXMLElementExport aNameElem( rExport, XML_NAMESPACE_DC,
   XML_NAME, true, false );
 rExport.Characters("bold"); // TODO: Get the correct style

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source sw/util

2016-06-06 Thread Rosemary Sebastian
 include/xmloff/xmlimp.hxx   |1 +
 sw/source/filter/xml/swxml.cxx  |7 +++
 sw/source/filter/xml/xmlimp.cxx |   11 +++
 sw/util/sw.component|   10 +++---
 4 files changed, 26 insertions(+), 3 deletions(-)

New commits:
commit cf849897b91af349afbf352bb529acf2b5e9ecfc
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Mon Jun 6 12:06:24 2016 +0530

Import tracked changes from undo.xml

Change-Id: If1003968accbc31acdb4b503940c53c01264e60c

diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 2261e47..c2c2474 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -96,6 +96,7 @@ enum class SvXMLImportFlags {
 SETTINGS= 0x0040,
 FONTDECLS   = 0x0080,
 EMBEDDED= 0x0100,
+UNDO= 0x0200,
 ALL = 0x
 };
 namespace o3tl
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 33c976f..95708ad 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -875,6 +875,13 @@ sal_uLong XMLReader::Read( SwDoc , const OUString& 
rBaseURL, SwPaM , c
 : "com.sun.star.comp.Writer.XMLContentImporter"),
aFilterArgs, rName, true );
 
+if( !nRet && !(IsOrganizerMode() || aOpt.IsFormatsOnly()) )
+nRet = ReadThroughComponent(
+   xStorage, xModelComp, "undo.xml", nullptr, xContext,
+(bOASIS ? "com.sun.star.comp.Writer.XMLOasisUndoImporter"
+: "com.sun.star.comp.Writer.XMLUndoImporter"),
+   aEmptyArgs, rName, true );
+
 if( !(IsOrganizerMode() || IsBlockMode() || bInsertMode ||
   aOpt.IsFormatsOnly() ) )
 {
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index e749b3a..f583259 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -95,6 +95,7 @@ enum SwXMLDocTokens
 XML_TOK_DOC_MASTERSTYLES,
 XML_TOK_DOC_META,
 XML_TOK_DOC_BODY,
+XML_TOK_DOC_UNDO,
 XML_TOK_DOC_SCRIPT,
 XML_TOK_DOC_SETTINGS,
 XML_TOK_DOC_XFORMS,
@@ -109,6 +110,7 @@ static SvXMLTokenMapEntry aDocTokenMap[] =
 { XML_NAMESPACE_OFFICE, XML_MASTER_STYLES,   XML_TOK_DOC_MASTERSTYLES   },
 { XML_NAMESPACE_OFFICE, XML_META,   XML_TOK_DOC_META},
 { XML_NAMESPACE_OFFICE, XML_BODY,   XML_TOK_DOC_BODY},
+{ XML_NAMESPACE_OFFICE, XML_UNDO,   XML_TOK_DOC_UNDO},
 { XML_NAMESPACE_OFFICE, XML_SCRIPTS,XML_TOK_DOC_SCRIPT  },
 { XML_NAMESPACE_OFFICE, XML_SETTINGS,   XML_TOK_DOC_SETTINGS},
 { XML_NAMESPACE_XFORMS, XML_MODEL,  XML_TOK_DOC_XFORMS  },
@@ -1596,4 +1598,13 @@ 
com_sun_star_comp_Writer_XMLOasisSettingsImporter_get_implementation(css::uno::X
 return cppu::acquire(new SwXMLImport(context, 
OUString("com.sun.star.comp.Writer.XMLOasisSettingsImporter"),
 SvXMLImportFlags::SETTINGS));
 }
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
+com_sun_star_comp_Writer_XMLOasisUndoImporter_get_implementation(css::uno::XComponentContext*
 context,
+css::uno::Sequence const &)
+{
+return cppu::acquire(new SwXMLImport(context, 
OUString("com.sun.star.comp.Writer.XMLOasisUndoImporter"),
+SvXMLImportFlags::UNDO | SvXMLImportFlags::AUTOSTYLES));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/util/sw.component b/sw/util/sw.component
index a76d30a..478e4a2 100644
--- a/sw/util/sw.component
+++ b/sw/util/sw.component
@@ -76,13 +76,17 @@
   
constructor="com_sun_star_comp_Writer_XMLOasisContentExporter_get_implementation">
 
   
+  
+
+  
   
 
   
-  
-
+  
+
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - 2 commits - include/xmloff sw/source xmloff/source

2016-06-06 Thread Rosemary Sebastian
Rebased ref, commits from common ancestor:
commit 28e1d02543b437e54c6dfa06141758ff8fe78baf
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Mon Jun 6 21:04:49 2016 +0530

Export addition of format

All the values are hardcoded currently.

Change-Id: I56ddfaa7f7facfc9c2359cd50031e6531ed05120

diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx
index ae588d2..da467d1 100644
--- a/include/xmloff/xmlnmspe.hxx
+++ b/include/xmloff/xmlnmspe.hxx
@@ -70,6 +70,8 @@ XML_NAMESPACE( REPORT,  33U )
 XML_NAMESPACE( OF,  34U )   // OpenFormula aka ODFF
 XML_NAMESPACE( XHTML,   35U )
 XML_NAMESPACE( GRDDL,   36U )
+XML_NAMESPACE( ADD, 37U )
+XML_NAMESPACE( DEL, 38U )
 
 // namespaces for odf extended formats
 
@@ -77,14 +79,14 @@ XML_NAMESPACE( GRDDL,   36U )
 const sal_uInt16 XML_NAMESPACE_##prefix##_EXT   = key; \
 const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX   = key;
 
-XML_NAMESPACE_EXT( OFFICE,  37U )
-XML_NAMESPACE_EXT( TABLE,   38U )
-XML_NAMESPACE_EXT( CHART,   39U )
-XML_NAMESPACE_EXT( DRAW,40U )
-XML_NAMESPACE_EXT( CALC,41U )
-XML_NAMESPACE_EXT( LO,  42U )
+XML_NAMESPACE_EXT( OFFICE,  39U )
+XML_NAMESPACE_EXT( TABLE,   40U )
+XML_NAMESPACE_EXT( CHART,   41U )
+XML_NAMESPACE_EXT( DRAW,42U )
+XML_NAMESPACE_EXT( CALC,43U )
+XML_NAMESPACE_EXT( LO,  44U )
 
-#define XML_OLD_NAMESPACE_BASE 43U
+#define XML_OLD_NAMESPACE_BASE 45U
 
 // namespaces used in the technical preview (SO 5.2)
 XML_OLD_NAMESPACE( FO,  0U )
diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index f7b38ef..c59fae5 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -487,6 +487,25 @@ void XMLRedlineExport::ExportChangeInfo(
 rExport.Characters(sBuf.makeStringAndClear());
 }
 
+aAny = rPropSet->getPropertyValue(sRedlineType);
+OUString sType;
+aAny >>= sType;
+if(sType == sFormat) // TODO: Find out if the style is inserted or deleted 
to give the proper namespace
+{
+SvXMLElementExport aTypeElem( rExport, XML_NAMESPACE_DEL,
+  XML_TYPE, true, false );
+rExport.Characters("style");
+SvXMLElementExport aNameElem( rExport, XML_NAMESPACE_DEL,
+  XML_NAME, true, false );
+rExport.Characters("bold"); // TODO: Get the correct style name
+SvXMLElementExport aStartElem( rExport, XML_NAMESPACE_DEL,
+  XML_START, true, false );
+rExport.Characters("start"); // TODO: Get the correct start position
+SvXMLElementExport aEndElem( rExport, XML_NAMESPACE_DEL,
+  XML_END, true, false );
+rExport.Characters("end"); // TODO: Get the correct end position
+}
+
 // comment as  sequence
 aAny = rPropSet->getPropertyValue(sRedlineComment);
 aAny >>= sTmp;
diff --git a/xmloff/source/text/XMLRedlineExport.hxx 
b/xmloff/source/text/XMLRedlineExport.hxx
index 5ef3d2e..08e8973 100644
--- a/xmloff/source/text/XMLRedlineExport.hxx
+++ b/xmloff/source/text/XMLRedlineExport.hxx
@@ -66,6 +66,10 @@ class XMLRedlineExport
 const OUString sRedlineSuccessorData;
 const OUString sRedlineText;
 const OUString sRedlineType;
+const OUString sRedlineUndoType;
+const OUString sRedlineUndoName;
+const OUString sRedlineUndoStart;
+const OUString sRedlineUndoEnd;
 const OUString sUnknownChange;
 const OUString sStartRedline;
 const OUString sEndRedline;
commit 49fa48961b58bae09b7872f8ff536b73d2a88f82
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Fri Jun 3 20:45:24 2016 +0530

WIP Save tracked changes in undo.xml

Change-Id: I41326b89788ad85646b777d2a8df81f03619ae9f

diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 87993a2..4213eb5 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -132,7 +132,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass 
)
 SwDoc *pDoc = getDoc();
 
 if( getExportFlags() & 
(SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES|
-
SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
+
SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::UNDO))
 {
 if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 )
 {
@@ -268,7 +268,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass 
)
 // set redline mode if we export STYLES or CONTENT, unless redline
 // mode is taken care of outside (through info XPropertySet)
 bool bSaveRedline =
-bool( getExportFla

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source sw/util

2016-06-06 Thread Rosemary Sebastian
 include/xmloff/xmlimp.hxx   |1 +
 sw/source/filter/xml/swxml.cxx  |7 +++
 sw/source/filter/xml/xmlimp.cxx |   11 +++
 sw/util/sw.component|   10 +++---
 4 files changed, 26 insertions(+), 3 deletions(-)

New commits:
commit ae525ba046e444a32fc01cbefe4e7ca110521bc7
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Mon Jun 6 12:06:24 2016 +0530

Import tracked changes from undo.xml - Part 1

Change-Id: If1003968accbc31acdb4b503940c53c01264e60c
Reviewed-on: https://gerrit.libreoffice.org/25950
Reviewed-by: Rosemary Sebastian <rosemarys...@gmail.com>
    Tested-by: Rosemary Sebastian <rosemarys...@gmail.com>

diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 2261e47..c2c2474 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -96,6 +96,7 @@ enum class SvXMLImportFlags {
 SETTINGS= 0x0040,
 FONTDECLS   = 0x0080,
 EMBEDDED= 0x0100,
+UNDO= 0x0200,
 ALL = 0x
 };
 namespace o3tl
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 33c976f..95708ad 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -875,6 +875,13 @@ sal_uLong XMLReader::Read( SwDoc , const OUString& 
rBaseURL, SwPaM , c
 : "com.sun.star.comp.Writer.XMLContentImporter"),
aFilterArgs, rName, true );
 
+if( !nRet && !(IsOrganizerMode() || aOpt.IsFormatsOnly()) )
+nRet = ReadThroughComponent(
+   xStorage, xModelComp, "undo.xml", nullptr, xContext,
+(bOASIS ? "com.sun.star.comp.Writer.XMLOasisUndoImporter"
+: "com.sun.star.comp.Writer.XMLUndoImporter"),
+   aEmptyArgs, rName, true );
+
 if( !(IsOrganizerMode() || IsBlockMode() || bInsertMode ||
   aOpt.IsFormatsOnly() ) )
 {
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index e749b3a..f583259 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -95,6 +95,7 @@ enum SwXMLDocTokens
 XML_TOK_DOC_MASTERSTYLES,
 XML_TOK_DOC_META,
 XML_TOK_DOC_BODY,
+XML_TOK_DOC_UNDO,
 XML_TOK_DOC_SCRIPT,
 XML_TOK_DOC_SETTINGS,
 XML_TOK_DOC_XFORMS,
@@ -109,6 +110,7 @@ static SvXMLTokenMapEntry aDocTokenMap[] =
 { XML_NAMESPACE_OFFICE, XML_MASTER_STYLES,   XML_TOK_DOC_MASTERSTYLES   },
 { XML_NAMESPACE_OFFICE, XML_META,   XML_TOK_DOC_META},
 { XML_NAMESPACE_OFFICE, XML_BODY,   XML_TOK_DOC_BODY},
+{ XML_NAMESPACE_OFFICE, XML_UNDO,   XML_TOK_DOC_UNDO},
 { XML_NAMESPACE_OFFICE, XML_SCRIPTS,XML_TOK_DOC_SCRIPT  },
 { XML_NAMESPACE_OFFICE, XML_SETTINGS,   XML_TOK_DOC_SETTINGS},
 { XML_NAMESPACE_XFORMS, XML_MODEL,  XML_TOK_DOC_XFORMS  },
@@ -1596,4 +1598,13 @@ 
com_sun_star_comp_Writer_XMLOasisSettingsImporter_get_implementation(css::uno::X
 return cppu::acquire(new SwXMLImport(context, 
OUString("com.sun.star.comp.Writer.XMLOasisSettingsImporter"),
 SvXMLImportFlags::SETTINGS));
 }
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
+com_sun_star_comp_Writer_XMLOasisUndoImporter_get_implementation(css::uno::XComponentContext*
 context,
+css::uno::Sequence const &)
+{
+return cppu::acquire(new SwXMLImport(context, 
OUString("com.sun.star.comp.Writer.XMLOasisUndoImporter"),
+SvXMLImportFlags::UNDO | SvXMLImportFlags::AUTOSTYLES));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/util/sw.component b/sw/util/sw.component
index a76d30a..478e4a2 100644
--- a/sw/util/sw.component
+++ b/sw/util/sw.component
@@ -76,13 +76,17 @@
   
constructor="com_sun_star_comp_Writer_XMLOasisContentExporter_get_implementation">
 
   
+  
+
+  
   
 
   
-  
-
+  
+
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - sw/source

2016-06-05 Thread Rosemary Sebastian
 sw/source/filter/xml/xmlexp.cxx  |   10 +-
 sw/source/filter/xml/xmlfmte.cxx |4 +++-
 2 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit cc6b4c67f69e8b0398f74360c89e359d1892d964
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Fri Jun 3 20:45:24 2016 +0530

Save tracked changes in undo.xml

Change-Id: I41326b89788ad85646b777d2a8df81f03619ae9f
Reviewed-on: https://gerrit.libreoffice.org/25874
Reviewed-by: Rosemary Sebastian <rosemarys...@gmail.com>
    Tested-by: Rosemary Sebastian <rosemarys...@gmail.com>

diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 87993a2..4213eb5 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -132,7 +132,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass 
)
 SwDoc *pDoc = getDoc();
 
 if( getExportFlags() & 
(SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES|
-
SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
+
SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::UNDO))
 {
 if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 )
 {
@@ -268,7 +268,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass 
)
 // set redline mode if we export STYLES or CONTENT, unless redline
 // mode is taken care of outside (through info XPropertySet)
 bool bSaveRedline =
-bool( getExportFlags() & 
(SvXMLExportFlags::CONTENT|SvXMLExportFlags::STYLES) );
+bool( getExportFlags() & 
(SvXMLExportFlags::UNDO|SvXMLExportFlags::STYLES) );
 if( bSaveRedline )
 {
 // if the info property set has a ShowChanges property,
@@ -483,7 +483,6 @@ void SwXMLExport::ExportContent_()
 }
 }
 
-GetTextParagraphExport()->exportTrackedChanges( false );
 GetTextParagraphExport()->exportTextDeclarations();
 Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
 Reference < XText > xText = xTextDoc->getText();
@@ -496,6 +495,7 @@ void SwXMLExport::ExportUndo_()
 {
 SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_UNDO,
 true, true );
+GetTextParagraphExport()->exportTrackedChanges( false );
 }
 
 namespace
@@ -572,7 +572,7 @@ 
com_sun_star_comp_Writer_XMLUndoExporter_get_implementation(css::uno::XComponent
 css::uno::Sequence const &)
 {
 return cppu::acquire(new SwXMLExport(context, 
OUString("com.sun.star.comp.Writer.XMLUndoExporter"),
-SvXMLExportFlags::UNDO));
+SvXMLExportFlags::UNDO | SvXMLExportFlags::AUTOSTYLES));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
@@ -622,7 +622,7 @@ 
com_sun_star_comp_Writer_XMLOasisUndoExporter_get_implementation(css::uno::XComp
 css::uno::Sequence const &)
 {
 return cppu::acquire(new SwXMLExport(context, 
OUString("com.sun.star.comp.Writer.XMLOasisUndoExporter"),
-SvXMLExportFlags::UNDO | SvXMLExportFlags::OASIS));
+SvXMLExportFlags::UNDO | SvXMLExportFlags::AUTOSTYLES | 
SvXMLExportFlags::OASIS));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index f50e8e2..312b8b2 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -201,10 +201,12 @@ void SwXMLExport::ExportAutoStyles_()
 if( !(getExportFlags() & SvXMLExportFlags::STYLES) )
 GetTextParagraphExport()->exportUsedDeclarations();
 
+if( getExportFlags() & SvXMLExportFlags::UNDO )
+GetTextParagraphExport()->exportTrackedChanges( true );
+
 // exported in ExportContent_
 if( getExportFlags() & SvXMLExportFlags::CONTENT )
 {
-GetTextParagraphExport()->exportTrackedChanges( true );
 Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
 Reference < XText > xText = xTextDoc->getText();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source sw/util xmloff/source

2016-06-02 Thread Rosemary Sebastian
 include/xmloff/xmlexp.hxx  |7 +-
 include/xmloff/xmltoken.hxx|2 +
 sw/source/core/inc/SwXMLBlockExport.hxx|2 +
 sw/source/filter/xml/wrtxml.cxx|   13 +++
 sw/source/filter/xml/xmlexp.cxx|   22 
 sw/source/filter/xml/xmlexp.hxx|1 
 sw/source/uibase/config/StoredChapterNumbering.cxx |1 
 sw/util/sw.component   |8 +++
 xmloff/source/core/xmlexp.cxx  |   23 -
 xmloff/source/core/xmltoken.cxx|2 +
 10 files changed, 79 insertions(+), 2 deletions(-)

New commits:
commit 2aa542764ff6816b14d500945666f72a4b3f7881
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Tue May 24 17:52:41 2016 +0530

Create undo.xml for change-tracking

Change-Id: I41a6de97b5c377e9a5c528c920d5c6e0195b7a10
Reviewed-on: https://gerrit.libreoffice.org/25404
Reviewed-by: Rosemary Sebastian <rosemarys...@gmail.com>
    Tested-by: Rosemary Sebastian <rosemarys...@gmail.com>

diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index 41e8ddd..c8adc64 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -100,12 +100,13 @@ enum class SvXMLExportFlags {
 NODOCTYPE= 0x0200,
 PRETTY   = 0x0400,
 SAVEBACKWARDCOMPATIBLE   = 0x0800,
+UNDO = 0x1000,
 OASIS= 0x8000,
 ALL  = 0x0fff
 };
 namespace o3tl
 {
-template<> struct typed_flags : 
is_typed_flags<SvXMLExportFlags, 0x8fff> {};
+template<> struct typed_flags : 
is_typed_flags<SvXMLExportFlags, 0x9fff> {};
 }
 
 class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6<
@@ -178,6 +179,7 @@ private:
 SAL_DLLPRIVATE void ImplExportMasterStyles();
 // 
 SAL_DLLPRIVATE void ImplExportContent(); // 
+SAL_DLLPRIVATE void ImplExportUndo(); // 
 virtual void SetBodyAttributes();
 void 
GetViewSettingsAndViews(css::uno::Sequence& rProps);
 
@@ -217,6 +219,9 @@ protected:
 /// Override this method to export the content of .
 virtual void ExportContent_() = 0;
 
+/// Export the content of  in writer.
+virtual void ExportUndo_();
+
 OUString GetSourceShellID() const;
 OUString GetDestinationShellID() const;
 
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index ccbb8cf..4ddc061 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -644,6 +644,7 @@ namespace xmloff { namespace token {
 XML_DOCUMENT_SETTINGS,
 XML_DOCUMENT_STATISTIC,
 XML_DOCUMENT_STYLES,
+XML_DOCUMENT_UNDO,
 XML_DOMAIN,
 XML_DOT,
 XML_DOTS1,
@@ -1922,6 +1923,7 @@ namespace xmloff { namespace token {
 XML_SINGLE,
 XML_SMALL_WAVE,
 XML_WAVE,
+XML_UNDO,
 XML_UNFORMATTED_TEXT,
 XML_UNION,
 XML_UNIT,
diff --git a/sw/source/core/inc/SwXMLBlockExport.hxx 
b/sw/source/core/inc/SwXMLBlockExport.hxx
index cbafb30..36515a0 100644
--- a/sw/source/core/inc/SwXMLBlockExport.hxx
+++ b/sw/source/core/inc/SwXMLBlockExport.hxx
@@ -41,6 +41,7 @@ public:
 void ExportAutoStyles_() override {}
 void ExportMasterStyles_ () override {}
 void ExportContent_() override {}
+void ExportUndo_() override {}
 };
 
 class SwXMLTextBlockExport : public SvXMLExport
@@ -61,6 +62,7 @@ public:
 void ExportAutoStyles_() override {}
 void ExportMasterStyles_ () override {}
 void ExportContent_() override {}
+void ExportUndo_() override {}
 };
 
 #endif
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 2fbdd81..735f973 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -366,6 +366,19 @@ sal_uInt32 SwXMLWriter::Write_( const uno::Reference < 
task::XStatusIndicator >&
 }
 }
 
+if( !bOrganizerMode && !bErr )
+{
+if( !WriteThroughComponent(
+xModelComp, "undo.xml", xContext,
+(bOASIS ? "com.sun.star.comp.Writer.XMLOasisUndoExporter"
+: "com.sun.star.comp.Writer.XMLUndoExporter"),
+aFilterArgs, aProps ) )
+{
+bErr = true;
+sErrFile = "undo.xml";
+}
+}
+
 if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() && 
pDoc->getIDocumentStatistics().GetDocStat().nPage > 1 &&
 !(bOrganizerMode || bBlock || bErr) )
 {
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 5865662..87993a2 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -492,6 +492,12 @@ void 

GSoC Week 1 Report

2016-06-01 Thread Rosemary Sebastian
Hello everyone

Here's a summary of the work done by me so far.

- Made changes to the writer model - created the undo.xml for writing
change-tracking information alone. [1]

- Worked through some examples on how we can match changes in a document to
the new format.

Currently I'm trying to write the change-tracking information into
undo.xml. The first test case we are considering is the deletion of a
single paragraph from a document with three paragraphs.

I've created a new branch 'private/Rosemary/change-tracking' for my project.

[1] https://gerrit.libreoffice.org/#/c/25778/

Regards
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Project proposal accepted for GSoC 2016

2016-05-14 Thread Rosemary Sebastian
Hello everyone

I am happy to announce that my project proposal with LibreOffice, "Saving
ODF XML of Change-tracking as a Sequence of Pre-defined Changes" [1], got
accepted for GSoC. Thorsten Behrens, Oliver Specht and Svante Schubert are
my mentors for the project.

I have already talked to my mentors and started looking into the
specifications and stuff. I have also started a blog [2] where I will be
posting progress updates during GSoC.

Looking forward to an exciting summer hacking on LibreOffice!

[1] Project abstract

[2] My blog 

Regards
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: sax/source

2016-05-04 Thread Rosemary Sebastian
 sax/source/tools/converter.cxx |   24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

New commits:
commit 9144a54a7612aa75cf58e857ddd4913f8bac6965
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sun May 1 14:46:15 2016 +0530

tdf#94260 Convert pixel to 1/100 mm

The scaling factor 0.28 is chosen as per
https://www.w3.org/TR/2001/REC-xsl-20011015/slice5.html#pixels

Change-Id: I8dc7846699fbb2aa6e2a181a041b66d3cc33b8e5
Reviewed-on: https://gerrit.libreoffice.org/24547
Reviewed-by: Oliver Specht <oliver.spe...@cib.de>
Tested-by: Oliver Specht <oliver.spe...@cib.de>

diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index d1f6c9f..39baec9 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -125,10 +125,11 @@ bool Converter::convertMeasure( sal_Int32& rValue,
 else
 {
 OSL_ENSURE( MeasureUnit::TWIP == nTargetUnit || MeasureUnit::POINT 
== nTargetUnit ||
-MeasureUnit::MM_100TH == nTargetUnit || 
MeasureUnit::MM_10TH == nTargetUnit, "unit is not supported");
-const sal_Char *aCmpsL[2] = { nullptr, nullptr };
-const sal_Char *aCmpsU[2] = { nullptr, nullptr };
-double aScales[2] = { 1., 1. };
+MeasureUnit::MM_100TH == nTargetUnit || 
MeasureUnit::MM_10TH == nTargetUnit ||
+MeasureUnit::PIXEL == nTargetUnit, "unit is not 
supported");
+const sal_Char *aCmpsL[3] = { nullptr, nullptr, nullptr };
+const sal_Char *aCmpsU[3] = { nullptr, nullptr, nullptr };
+double aScales[3] = { 1., 1., 1. };
 
 if( MeasureUnit::TWIP == nTargetUnit )
 {
@@ -196,6 +197,10 @@ bool Converter::convertMeasure( sal_Int32& rValue,
 aCmpsL[1] = "pc";
 aCmpsU[1] = "PC";
 aScales[1] = (10.0 * nScaleFactor*2.54)/12.; // mm/100
+
+aCmpsL[2] = "px";
+aCmpsU[2] = "PX";
+aScales[2] = 0.28 * nScaleFactor; // mm/100
 break;
 }
 }
@@ -213,22 +218,23 @@ bool Converter::convertMeasure( sal_Int32& rValue,
 return false;
 
 double nScale = 0.;
-for( sal_uInt16 i= 0; i < 2; i++ )
+for( sal_uInt16 i= 0; i < 3; i++ )
 {
+sal_Int32 nTmp = nPos; // come back to the initial position 
before each iteration
 const sal_Char *pL = aCmpsL[i];
 if( pL )
 {
 const sal_Char *pU = aCmpsU[i];
-while( nPos < nLen && *pL )
+while( nTmp < nLen && *pL )
 {
-sal_Unicode c = rString[nPos];
+sal_Unicode c = rString[nTmp];
 if( c != *pL && c != *pU )
 break;
 pL++;
 pU++;
-nPos++;
+nTmp++;
 }
-if( !*pL && (nPos == nLen || ' ' == rString[nPos]) )
+if( !*pL && (nTmp == nLen || ' ' == rString[nTmp]) )
 {
 nScale = aScales[i];
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source

2016-05-01 Thread Rosemary Sebastian
 editeng/source/uno/unofield.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 87cccfbf7e9c3031bb12dd966626f28e134c8f75
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Sun May 1 14:53:20 2016 +0530

Replace '||' with '&&'

so that the condition doesn't always evaluate to true

Change-Id: I66ba3d4c7985e1fad60f12836e44167f19216588
Reviewed-on: https://gerrit.libreoffice.org/24548
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 5339875..1ae11c5 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -481,7 +481,7 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const 
throw()
 {
 static_cast<SvxAuthorField*>(pData)->SetFormat( 
SVXAUTHORFORMAT_SHORTNAME );
 }
-else if( mpImpl->mnInt16 >= SVXAUTHORFORMAT_FULLNAME || 
mpImpl->mnInt16 <= SVXAUTHORFORMAT_SHORTNAME )
+else if( mpImpl->mnInt16 >= SVXAUTHORFORMAT_FULLNAME && 
mpImpl->mnInt16 <= SVXAUTHORFORMAT_SHORTNAME )
 {
 static_cast<SvxAuthorField*>(pData)->SetFormat( (SvxAuthorFormat) 
mpImpl->mnInt16 );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Fwd: Interested to work on GSoC project

2016-03-11 Thread Rosemary Sebastian
Hello everyone

I'm Rosemary, a final year student of B.Tech. in Computer Science and
Engineering.

I found the project "Saving ODF XML of Change-Tracking as a sequence of
predefined Changes" interesting as it looks similar to the projects I've
worked on in LibreOffice. So I'd like to work on it for GSoC 2016.

My contributions to LibreOffice include:

   1. Writing an export filter for the export of VBA streams to MSO
   formats; moggi was my mentor for this corehack.
   2. Implementing OOXML export and import of Impress text fields; bubli
   mentored me for this one.

My IRC nickname is roses and my email ID is rosemary.seb8 at gmail dot com

Regards
Rosemary
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: oox/source sd/qa

2016-02-08 Thread Rosemary Sebastian
 oox/source/drawingml/textfield.cxx   |   15 
 oox/source/export/drawingml.cxx  |   12 +++
 sd/qa/unit/data/odp/author_field.odp |binary
 sd/qa/unit/data/odp/slidecount_field.odp |binary
 sd/qa/unit/data/odp/slidename_field.odp  |binary
 sd/qa/unit/data/odp/slidenum_field.odp   |binary
 sd/qa/unit/data/pptx/slidenum_field.pptx |binary
 sd/qa/unit/export-tests.cxx  |  114 ---
 sd/qa/unit/sdmodeltestbase.hxx   |   19 +
 9 files changed, 120 insertions(+), 40 deletions(-)

New commits:
commit 33d289d53fef36b8e7c4db4a9c9ddd9c1f2edbb2
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Wed Feb 3 09:15:19 2016 +0530

Export and import of additional fields in Impress

These include
  - Author
  - Page Count
  - Page Name
Export and import of slide number was already implemented. A test
for the same has been added along with the tests for the newly
implemented field exports.

In sdmodeltestbase.hxx a new method getTextFieldFromPage has been
added to reduce copy-paste code

Change-Id: Icf54b91a7db4b3cccd9d0666a2706e3cc2a89d9a
Reviewed-on: https://gerrit.libreoffice.org/22065
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>

diff --git a/oox/source/drawingml/textfield.cxx 
b/oox/source/drawingml/textfield.cxx
index 7a33898..0db6692 100644
--- a/oox/source/drawingml/textfield.cxx
+++ b/oox/source/drawingml/textfield.cxx
@@ -140,6 +140,16 @@ void lclCreateTextFields( std::list< Reference< XTextField 
> > & aFields,
 xIface = xFactory->createInstance( 
"com.sun.star.text.TextField.PageNumber" );
 aFields.push_back( Reference< XTextField > ( xIface, UNO_QUERY ) );
 }
+else if ( sType == "slidecount" )
+{
+xIface = xFactory->createInstance( 
"com.sun.star.text.TextField.PageCount" );
+aFields.push_back( Reference< XTextField > ( xIface, UNO_QUERY ) );
+}
+else if ( sType == "slidename" )
+{
+xIface = xFactory->createInstance( 
"com.sun.star.text.TextField.PageName" );
+aFields.push_back( Reference< XTextField > ( xIface, uno::UNO_QUERY ) 
);
+}
 else if ( sType.startsWith("file") )
 {
 OString s = OUStringToOString( sType, RTL_TEXTENCODING_UTF8);
@@ -164,6 +174,11 @@ void lclCreateTextFields( std::list< Reference< XTextField 
> > & aFields,
 xProps->setPropertyValue("FileFormat", makeAny(0));
 }
 }
+else if( sType == "author" )
+{
+xIface = xFactory->createInstance( 
"com.sun.star.text.TextField.Author" );
+aFields.push_back( Reference< XTextField > ( xIface, UNO_QUERY ) );
+}
 }
 
 } // namespace
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 282436b..22e67ad 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1491,6 +1491,14 @@ OUString DrawingML::GetFieldValue( css::uno::Reference< 
css::text::XTextRange >
 {
 aFieldValue = "slidenum";
 }
+else if( aFieldKind == "Pages" )
+{
+aFieldValue = "slidecount";
+}
+else if( aFieldKind == "PageName" )
+{
+aFieldValue = "slidename";
+}
 else if( aFieldKind == "URL" )
 {
 bIsURLField = true;
@@ -1545,6 +1553,10 @@ OUString DrawingML::GetFieldValue( css::uno::Reference< 
css::text::XTextRange >
 case 3: aFieldValue = "file3"; // File name with 
extension
 }
 }
+else if(aFieldKind == "Author")
+{
+aFieldValue = "author";
+}
 }
 }
 }
diff --git a/sd/qa/unit/data/odp/author_field.odp 
b/sd/qa/unit/data/odp/author_field.odp
new file mode 100644
index 000..ace132d
Binary files /dev/null and b/sd/qa/unit/data/odp/author_field.odp differ
diff --git a/sd/qa/unit/data/odp/slidecount_field.odp 
b/sd/qa/unit/data/odp/slidecount_field.odp
new file mode 100644
index 000..c8f5bd4
Binary files /dev/null and b/sd/qa/unit/data/odp/slidecount_field.odp differ
diff --git a/sd/qa/unit/data/odp/slidename_field.odp 
b/sd/qa/unit/data/odp/slidename_field.odp
new file mode 100644
index 000..e1a119b
Binary files /dev/null and b/sd/qa/unit/data/odp/slidename_field.odp differ
diff --git a/sd/qa/unit/data/odp/slidenum_field.odp 
b/sd/qa/unit/data/odp/slidenum_field.odp
new file mode 100644
index 000..e7789a3
Binary files

[Libreoffice-commits] core.git: oox/source sd/qa

2016-02-02 Thread Rosemary Sebastian
 oox/source/drawingml/textfield.cxx|   24 +
 oox/source/export/drawingml.cxx   |   15 +++
 sd/qa/unit/data/odp/extfile_field.odp |binary
 sd/qa/unit/export-tests.cxx   |   46 ++
 4 files changed, 85 insertions(+)

New commits:
commit 04eba5f599b8ac2accfc1d6abc74a91c38616691
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Fri Jan 29 19:15:08 2016 +0530

Export and import of file name field

Change-Id: Ic2c8ce0ff2a54079ef81f6ce2770497a9d22c7b6
Reviewed-on: https://gerrit.libreoffice.org/21902
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>

diff --git a/oox/source/drawingml/textfield.cxx 
b/oox/source/drawingml/textfield.cxx
index 7c5fba0..7a33898 100644
--- a/oox/source/drawingml/textfield.cxx
+++ b/oox/source/drawingml/textfield.cxx
@@ -140,6 +140,30 @@ void lclCreateTextFields( std::list< Reference< XTextField 
> > & aFields,
 xIface = xFactory->createInstance( 
"com.sun.star.text.TextField.PageNumber" );
 aFields.push_back( Reference< XTextField > ( xIface, UNO_QUERY ) );
 }
+else if ( sType.startsWith("file") )
+{
+OString s = OUStringToOString( sType, RTL_TEXTENCODING_UTF8);
+OString p( s.pData->buffer + 4 );
+int idx = p.toInt32();
+xIface = xFactory->createInstance( 
"com.sun.star.text.TextField.FileName" );
+aFields.push_back( Reference< XTextField > ( xIface, UNO_QUERY ) );
+Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW );
+
+switch( idx )
+{
+case 1: // Path
+xProps->setPropertyValue("FileFormat", makeAny(1));
+break;
+case 2: // File name without extension
+xProps->setPropertyValue("FileFormat", makeAny(2));
+break;
+case 3: // File name with extension
+xProps->setPropertyValue("FileFormat", makeAny(3));
+break;
+default: // Path/File name
+xProps->setPropertyValue("FileFormat", makeAny(0));
+}
+}
 }
 
 } // namespace
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index f990212..4d867269 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1530,6 +1530,21 @@ OUString DrawingML::GetFieldValue( css::uno::Reference< 
css::text::XTextRange >
 break;
 }
 }
+else if(aFieldKind == "ExtFile")
+{
+sal_Int32 nNumFmt = -1;
+rXPropSet->getPropertyValue(UNO_TC_PROP_FILE_FORMAT) >>= 
nNumFmt;
+switch(nNumFmt)
+{
+case 0: aFieldValue = "file"; // Path/File name
+break;
+case 1: aFieldValue = "file1"; // Path
+break;
+case 2: aFieldValue = "file2"; // File name without 
extension
+break;
+case 3: aFieldValue = "file3"; // File name with 
extension
+}
+}
 }
 }
 }
diff --git a/sd/qa/unit/data/odp/extfile_field.odp 
b/sd/qa/unit/data/odp/extfile_field.odp
new file mode 100644
index 000..e5425be
Binary files /dev/null and b/sd/qa/unit/data/odp/extfile_field.odp differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 17ecbd2..18919f2 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -139,6 +139,7 @@ public:
 void testExportTransitionsPPTX();
 void testDatetimeFieldNumberFormat();
 void testDatetimeFieldNumberFormatPPTX();
+void testExtFileField();
 
 void testFdo90607();
 void testTdf91378();
@@ -192,6 +193,7 @@ public:
 CPPUNIT_TEST(testTdf92527);
 CPPUNIT_TEST(testDatetimeFieldNumberFormat);
 CPPUNIT_TEST(testDatetimeFieldNumberFormatPPTX);
+CPPUNIT_TEST(testExtFileField);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1589,6 +1591,50 @@ void SdExportTest::testDatetimeFieldNumberFormatPPTX()
 xDocShRef->DoClose();
 }
 
+void SdExportTest::testExtFileField()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(getURLFromSrc("/sd/qa/unit/data/odp/extfile_field.odp"), ODP);
+
+xDocShRef = saveAndReload( xDocShRef, PPTX );
+
+for(sal_uInt16 i = 0; i <= 3; ++i)
+{
+// get TextShape i + 1 from the first page
+uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( i, 0, 
xDocShRef ) );
+
+// Get first paragraph
+un

[Libreoffice-commits] core.git: oox/source sd/qa

2016-01-27 Thread Rosemary Sebastian
 oox/source/drawingml/textfield.cxx |   19 ++-
 sd/qa/unit/data/odp/numfmt.odp |binary
 sd/qa/unit/data/pptx/numfmt.pptx   |binary
 sd/qa/unit/export-tests.cxx|   90 +
 4 files changed, 107 insertions(+), 2 deletions(-)

New commits:
commit 2b0669eec0d86e973a7d8def8744c522bbf8af8b
Author: Rosemary Sebastian <rosemarys...@gmail.com>
Date:   Mon Jan 25 12:40:35 2016 +0530

Format the datetime fields properly on import

Make sure that, after export, the datetime fields in impress are
imported with the correct number format.

Change-Id: I5565fef69b3a62e7dd59ea0d39cde151fb0af976
Reviewed-on: https://gerrit.libreoffice.org/21610
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>

diff --git a/oox/source/drawingml/textfield.cxx 
b/oox/source/drawingml/textfield.cxx
index 135ef31..7c5fba0 100644
--- a/oox/source/drawingml/textfield.cxx
+++ b/oox/source/drawingml/textfield.cxx
@@ -60,7 +60,6 @@ void lclCreateTextFields( std::list< Reference< XTextField > 
> & aFields,
 {
 Reference< XInterface > xIface;
 Reference< XMultiServiceFactory > xFactory( xModel, UNO_QUERY_THROW );
-
 if( sType.startsWith("datetime"))
 {
 OString s = OUStringToOString( sType, RTL_TEXTENCODING_UTF8);
@@ -69,6 +68,7 @@ void lclCreateTextFields( std::list< Reference< XTextField > 
> & aFields,
 {
 bool bIsDate = true;
 int idx = p.toInt32();
+sal_uInt16 nNumFmt;
 //  OSL_TRACE( "OOX: p = %s, %d", p.pData->buffer, idx );
 xIface = xFactory->createInstance( 
"com.sun.star.text.TextField.DateTime" );
 aFields.push_back( Reference< XTextField > ( xIface, UNO_QUERY ) );
@@ -79,10 +79,14 @@ void lclCreateTextFields( std::list< Reference< XTextField 
> > & aFields,
 {
 case 1: // Date dd/mm/
 // this is the default format...
+nNumFmt = 5;
+xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
 break;
 case 2: // Date Day, Month dd, 
 break;
 case 3: // Date dd Month 
+nNumFmt = 3;
+xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
 break;
 case 4: // Date Month dd, 
 break;
@@ -100,17 +104,28 @@ void lclCreateTextFields( std::list< Reference< 
XTextField > > & aFields,
 break;
 case 10: // Time H:MM
 bIsDate = false;
+nNumFmt = 3;
+xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
 break;
 case 11: // Time H:MM:SS
 bIsDate = false;
 // this is the default format
+nNumFmt = 2;
+xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
 break;
 case 12: // Time H:MM PM
 bIsDate = false;
+nNumFmt = 6;
+xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
 break;
 case 13: // Time H:MM:SS PM
 bIsDate = false;
+nNumFmt = 7;
+xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
 break;
+default:
+nNumFmt = 2;
+xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
 }
 xProps->setPropertyValue( "IsDate", makeAny( bIsDate ) );
 xProps->setPropertyValue( "IsFixed", makeAny( false ) );
@@ -190,4 +205,4 @@ sal_Int32 TextField::insertAt(
 
 } }
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/sd/qa/unit/data/odp/numfmt.odp b/sd/qa/unit/data/odp/numfmt.odp
new file mode 100644
index 000..6fd32ce
Binary files /dev/null and b/sd/qa/unit/data/odp/numfmt.odp differ
diff --git a/sd/qa/unit/data/pptx/numfmt.pptx b/sd/qa/unit/data/pptx/numfmt.pptx
new file mode 100755
index 000..aca6927
Binary files /dev/null and b/sd/qa/unit/data/pptx/numfmt.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 211cff2..17ecbd2 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -137,6 +137,8 @@ public:
 void testParaMarginAndindentation();
 void testTransparentBackground();
 void testExportTransitionsPPTX();
+void testDatetimeFieldNumberFormat();
+void testDatetimeFieldNumberFormatPPTX();
 
 void testFdo90607();
 void testT

Rosemary Sebastian All of my past future contributions to LibreOffice may be licensed under the MPLv2/LGPLv3+ dual license.

2015-06-23 Thread Rosemary Sebastian

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Rosemary Sebastian Code Contributor

2015-06-08 Thread Rosemary Sebastian
All of my past  future contributions to LibreOffice may be
licensed under the MPLv2/LGPLv3+ dual license.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice