[Libreoffice-commits] core.git: Branch 'feature/glyphy' - 2 commits - external/glyphy RepositoryExternal.mk sc/sdi sc/source vcl/Library_vcl.mk

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Oct 14 06:07:43 PDT 2015


 RepositoryExternal.mk                     |   24 +++++++++++
 external/glyphy/ExternalPackage_glyphy.mk |    6 ++
 sc/sdi/cellsh.sdi                         |    1 
 sc/source/ui/view/cellsh3.cxx             |   65 ++++++++++++++++++++++++++++++
 vcl/Library_vcl.mk                        |    4 +
 5 files changed, 100 insertions(+)

New commits:
commit 3f8c6c3f406fa5bcba455187b8db900288223b6c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Oct 14 15:06:55 2015 +0200

    link vcl against libglyphy
    
    Change-Id: I5b206f5d857d28acda82ce8ac53f835142f46da2

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index c6bfa12..a383ca3 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -288,6 +288,30 @@ endef
 
 endif # SYSTEM_GLEW
 
+$(eval $(call gb_Helper_register_packages_for_install,ooo,\
+	liborcus \
+))
+
+ifneq ($(SYSTEM_GLEW),)
+
+else # !SYSTEM_GLYPHY
+
+define gb_LinkTarget__use_glyphy
+$(call gb_LinkTarget_use_package,$(1),glyphy)
+
+$(call gb_LinkTarget_set_include,$(1),\
+	-I$(call gb_UnpackedTarball_get_dir,glyphy/include) \
+	$$(INCLUDE) \
+)
+
+$(call gb_LinkTarget_add_libs,$(1),\
+	-L$(call gb_UnpackedTarball_get_dir,glyphy)/src/.libs -lglyphy \
+)
+
+endef
+
+endif GLYPHY
+
 define gb_LinkTarget__use_iconv
 $(call gb_LinkTarget_add_libs,$(1),-liconv)
 
diff --git a/external/glyphy/ExternalPackage_glyphy.mk b/external/glyphy/ExternalPackage_glyphy.mk
index 484590d..cbae840 100644
--- a/external/glyphy/ExternalPackage_glyphy.mk
+++ b/external/glyphy/ExternalPackage_glyphy.mk
@@ -11,4 +11,10 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,glyphy,glyphy))
 
 $(eval $(call gb_ExternalPackage_use_external_project,glyphy,glyphy))
 
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,glyphy,$(LIBO_LIB_FOLDER)/libglyphy.dylib,src/.libs/libglyphy.dylib))
+else ifeq ($(DISABLE_DYNLOADING),)
+$(eval $(call gb_ExternalPackage_add_file,glyphy,$(LIBO_LIB_FOLDER)/libglyphy.so.0,src/.libs/libglyphy.so.0.0.0))
+endif
+
 # vim: set noet sw=4 ts=4:
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index f95a999..f40a1af 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -728,6 +728,10 @@ $(eval $(call gb_Library_add_libs,vcl,\
     -lX11 \
 ))
 
+$(eval $(call gb_Library_use_externals,vcl,\
+	glyphy \
+))
+
 $(eval $(call gb_Library_add_exception_objects,vcl,\
 	vcl/opengl/x11/X11DeviceInfo \
 ))
commit c6eb086d149fe0ae7a52201c8287f628105c9f52
Author: Justin Luth <justin_luth at sil.org>
Date:   Thu Sep 17 09:07:59 2015 +0300

    tdf#73691 - add alt-x support for calc selected cells
    
    Change-Id: Icd70e2ac8d31dfb3f6bc5842ce0bcdf91c706361

diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index f043ebd..f284c4e 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -198,6 +198,7 @@ interface CellSelection
     SID_INSERT_POSTIT   [ ExecMethod = ExecuteEdit; StateMethod = GetCellState; ]
     SID_EDIT_POSTIT   [ ExecMethod = ExecuteEdit; StateMethod = GetCellState; ]
 
+    SID_UNICODE_NOTATION_TOGGLE [ ExecMethod = Execute; ]
     SID_COLLABORATION       [ ExecMethod = Execute; ]
     SID_TABOP               [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
     SID_CONSOLIDATE         [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 6b2dd8d..900419ca 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -41,6 +41,7 @@
 #include "editable.hxx"
 #include "markdata.hxx"
 #include "scabstdlg.hxx"
+#include <i18nutil/unicode.hxx>
 
 #include <config_telepathy.h>
 
@@ -94,6 +95,11 @@ void ScCellShell::Execute( SfxRequest& rReq )
 
                     break;
 
+            case SID_UNICODE_NOTATION_TOGGLE:
+                    //unexpected situation. If editable, Alt-X might be activated twice, so cancel this quietly
+                    rReq.Done();
+                    return;
+
             default:
                     break;
         }
@@ -398,6 +404,65 @@ void ScCellShell::Execute( SfxRequest& rReq )
             }
             break;
 
+        case SID_UNICODE_NOTATION_TOGGLE:
+            {
+                const ScViewData* pData = GetViewData();
+                const SCTAB nTab = pData->GetTabNo();
+                ScMarkData aMD = pData->GetMarkData();
+
+                //if no selection, use the current cell
+                if( !aMD.IsMarked() )
+                    aMD.SetMarkArea( pData->GetCurPos() );
+
+                //if more than one sheet selected, or selected sheet is somehow not the current sheet
+                if( (aMD.GetSelectCount() > 1) || (aMD.GetFirstSelected() != nTab) )
+                {
+                    pTabViewShell->ErrorMessage(STR_INVALID_TABREF);  //Invalid sheet reference.
+                    rReq.Done();
+                    return;
+                }
+
+                const ScDocument* pDoc = pData->GetDocument();
+                bool bOnlyNotBecauseOfMatrix;
+                //if any part of the selection would not be editable, cancel with error message
+                if( !pDoc->IsSelectionEditable(aMD, &bOnlyNotBecauseOfMatrix) )
+                {
+                    pTabViewShell->ErrorMessage(STR_PROTECTIONERR);
+                    rReq.Done();
+                    return;
+                }
+
+                const ScRangeList aRange = aMD.GetMarkedRanges();
+                const OUString aUndo = ScGlobal::GetRscString( STR_UNDO_TABOP );  //Multiple.Operations
+                pData->GetDocShell()->GetUndoManager()->EnterListAction( aUndo, aUndo );
+
+                //iterate through multiple ranges.  For each cell in the ranges, toggle unicode codepoints
+                for( size_t nIter = 0; nIter < aRange.size(); ++nIter )
+                {
+                    for( SCROW nRow = aRange[nIter]->aStart.Row(); nRow <= aRange[nIter]->aEnd.Row(); ++nRow )
+                    {
+                        for( SCCOL nCol = aRange[nIter]->aStart.Col(); nCol <= aRange[nIter]->aEnd.Col(); ++nCol )
+                        {
+                            const OUString sInput = pDoc->GetString(nCol, nRow, nTab);
+                            sal_Int32 nUtf16Pos = sInput.getLength();
+                            ToggleUnicodeCodepoint aToggle;
+                            while( nUtf16Pos && aToggle.AllowMoreInput( sInput[nUtf16Pos-1]) )
+                                --nUtf16Pos;
+
+                            OUStringBuffer sReplacement = aToggle.ReplacementString();
+                            if( !sReplacement.isEmpty() )
+                            {
+                                sReplacement.insert( 0, sInput.copy(0, sInput.getLength() - aToggle.StringToReplace().getLength()) );
+                                pTabViewShell->EnterData(nCol, nRow, nTab, sReplacement.toString());
+                            }
+                        }
+                    }
+                }
+                pData->GetDocShell()->GetUndoManager()->LeaveListAction();
+            }
+            rReq.Done();
+            break;
+
         case SID_SCENARIOS:
             {
                 ScDocument* pDoc = GetViewData()->GetDocument();


More information about the Libreoffice-commits mailing list