Feature autoclosing double quotes (strings) implemented.
When the user presses the '"' key, it's pair is also being inserted (only when the previous character is also a '"'), and the cursor is being placed inside the two quotes.
Also, if the there was a string (like: "aaa""), the second one is not inserted.
Change-Id: I3e4a5e426d2d4bdbf56899fe3e36359ae161b52a
Now, function procedure autoclose is working.
Created a struct named IncompleteProcData to store the line number, type and name of the inclomplete procedure. Procedures are store in a vector (IncompleteProcedures), and are as a member in SbModule.
I've created a function called SbModule::GetIncompleteProcedures() to extract the data. Data extraction uses SbModule::SetSource32, beacuse that one tokenizes sthe source file, and recognizes procedures.
Closing procedures is triggered ky pressing the Enter key when typing. It checks the actual sub, and if it's incomplete, adds the correct ending( End Sub/End Function).
There is only one problem: function SbModule::SetSource32 is not too often calle, maybe extraction should be done by a timer.
Change-Id: Id88daaef329e8b5c194b765c5261d356bfb3a0c9
Added a function to disable QuickSelectionEngine in ListBox, beacuse it's not needed.
ListBox navigation changed: it is not hiding/showing entries, instead of it, jumps to the longest match without filtering.
Arrow behavior remains the same.
Change-Id: I8982c280f20929c74f9630cbaa95010820d2e234
The CodeCompleteDataCache got a new implementation: global variables are stored separately.
The "static const" OUString-s were removed from the class.
Data extraction is only done when pressing the dot key.
Change-Id: I3ff94c0c6eabe328761336d4c74744eb7efc6056
Created a ModalDialog named CodeCompleteOptionsDlg to edit options for code completition/suggestion.
Unimplemented features in it are disabled.
The dialog window uses Glade .ui file.
Change-Id: I1b59f386a9575aa25b38c5a1d7d1f020498a69ab
Menu entry is added under View->Enable Code Completition when in Experimental mode.
Fixed the call of funtion SbModule::GetCodeCompleteDataFromParse() to be called only when code completition is enabled.
Replaced the occurences of SvtMiscOptions to CodeCompleteOptions.
Change-Id: If0520123ab5f612d7d24fb98f8e9bf6881af76cb
Fixed the definition of GLOB_KEY, NOT_FOUND from const to static const.
Added a new menu entry for code completition under View->Enable Code Completition.
Change-Id: If8ac25ee43a7ba780ccdee2e5e909777115a1f27
CodeCompleteWindow is hidden when clicking out: thi is implemented in
EditorWindow::MouseButtonDown: if CodeCompleteWindow is visible and
the actual TextSelection of the window and the parent's TextView is
different, hide the window (I assume the user changed selection, eg.
clicked on other line, etc.).
Change-Id: Icb6bcffa837b2f7e1ccef288b9d762e27649410b
Fixed the link error: declared CodeCompleteDataCache as BASIC_DLLPUBLIC and it worked fine.
Fixed sergmentation fault error in CodeCompleteWindow.
The new cache implementation is fully functional.
CodeCompleteWindow is now being used as boost::scoped_ptr.
Change-Id: I76a0fc7407d589e7f94280fc4d50cea51b9639db
WARNING: cache implementation gives a link error to it's methods.
Created the cache called CodeCompleteDataCache in file include/basic/codecompletecache.hxx
This class should replace the std::vector< CodeCompleteData > int file baside2b.cxx
When issuing command "make basic", it compiles fine, but, when "make basctl", it gives a link error (ld returned status 1) to CodeCompleteDataCache's methods.
Change-Id: If78c6533b7fb5653cc459d22b80c98d097b886eb
ListBox sorts entries alphabetically.
When typing, filters the matching function names.
ListBox closes on key tab and space, beacuse I assume the user typed in the
whole function name.
Change-Id: I045b1b990b0e0af70de75c32249b7497b51b9e98
Added a function to select the first entry in the ListBox by default.
Selected entry can be inserted with the ENTER key.
Fixed some code in basic code generation class (SbiCodeGen).
Change-Id: Ia6eb43ee5661a0a3ae0b738b619f19972f019eac
Fixed the window width to adopt size by longest entry.
Window height is set to display 8 lines, plus the scrollbar.
When selected, window can be close by the ESC key( done by PreNotify() ).
Also, renamed it to CodeCompleteWindow for consistency.
Change-Id: I9cd53c3d868cdaeb8d391547f16da7038278154b
Changed CodeCompleteListBox into a Window which contains a single ListBox.
Navigation with arrows is enabled, window closes on ESC key.
Double click inserts the selected method into the source code.
Visible line count in ListBox is set to 8 lines, width is adopted from the
longest entry.
Change-Id: I6b6ceb0ce78f9fc727aed53952dc6ee24cba47df
Ive fixed the parameter problem: I use the tokens created
by the syntax highlighter (it's struct HighlightPortion),
and put the identiiers to the vector, and reflect them.
Change-Id: I08888e4a8bf00fa987a16466f4a5ac03836e5ee7
This week I've managed to fix the ListBox appearance. Also, I've modified the code: it gets the data on insert/remove/change, and gets updated only when the dot is pressed. This makes the data to be up-to-date. Next, I wrote a Split(OUString , char) function to do the nested reflection (It works, but it will need some tweaks later). Also, code generation is disabled for code completition (just a boolean value, maybe it could be done in a more "elegant" way, like the error supression).
Change-Id: I43d250c0a065351950ac6424dcd88266d70bcef3
This patch allows the pop-up CodeCompleteListBox to appear under the cursor.
It's size is fixed:150x150.
Also, I've fixed a bug in extracting the current variable name.
Change-Id: Id98cb1c29be72af07a25aac3d51561f072bf103e
This patch allows the Code Completition feature to list methods in a custom ListBox class called CodeCompleteListBox.
So, when the user presses the dot("."), a ListBox appears, and listed the methods(not just prints on the terminal).
The user can select one from them, and it is put in the source code (after the dot).
Change-Id: Ie5165e7bdaae1d96bbf40a9b996ca8ebbdb40dea
This is an early version. I use the BASIC parser to parse the source,
then the infromation is extracted from the symbol table built by parser.
Error reporting is suppressed, beacuse it is not needed fro code completition.
I placed my function inside SbModule, and created a struct called CodeCompletitionData, which holds the object's name, it's parent, and it's type name.
This function, SbMethod::GetCodeCompleteDataFromParse() is called from Basic IDE's Notify function, which updates a cache(actually, reassigns a viariable :) ).
Later, in the EditorWindow::KeyInput function there is a check wheteher dot key is pressed. After that, the actual variable (or word) is being looked up in the vector that holds code completition data. And finally, if it is found, it's methods are printed on the terminal.
Change-Id: Idaf19baa8f720b8b117a76dc3cc2f90dd04fd155
Compiler plugin to replace with matching number(), boolean() or OUString ctor,
ran it, few manual tweaks, mark as really deprecated.
Change-Id: I4a79bdbcf4c460d21e73b635d2bd3725c22876b2
...as is reproducible when creating a new dialog via "Tools - Macros - Organize
Dialogs", adding e.g. some date/time controls to it, then closing LO.
Invalid read of size 8
at 0x23DD58DB: basctl::Layout::SplittedSide::Remove(basctl::DockingWindow*) (/basctl/source/basicide/layout.cxx:205)
by 0x23DD4F65: basctl::Layout::Remove(basctl::DockingWindow*) (/basctl/source/basicide/layout.cxx:62)
by 0x23D847B7: basctl::DialogWindowLayout::RemovePropertyBrowser() (/basctl/source/basicide/baside3.cxx:1459)
by 0x23E45AB3: basctl::PropBrw::~PropBrw() (/basctl/source/dlged/propbrw.cxx:202)
by 0x23E45BA5: basctl::PropBrw::~PropBrw() (/basctl/source/dlged/propbrw.cxx:205)
by 0x7E03A49: VCLXDevice::DestroyOutputDevice() (/toolkit/source/awt/vclxdevice.cxx:56)
by 0x7E4655D: VCLXWindow::dispose() (/toolkit/source/awt/vclxwindow.cxx:956)
by 0x7FD451C: UnoWrapper::WindowDestroyed(Window*) (/toolkit/source/helper/unowrapper.cxx:263)
by 0x95EA632: Window::~Window() (/vcl/source/window/window.cxx:4365)
by 0x23DD4EFD: basctl::Layout::~Layout() (/basctl/source/basicide/layout.cxx:56)
by 0x23D89E39: basctl::DialogWindowLayout::~DialogWindowLayout() (in /data/lo/core/solver/unxlngx6/installation/opt/program/libbasctllo.so)
by 0x23D89E69: basctl::DialogWindowLayout::~DialogWindowLayout() (/basctl/source/inc/baside3.hxx:125)
...
Address 0x19d17da0 is 0 bytes inside a block of size 80 free'd
at 0x4A078DE: operator delete(void*) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x23DD92D5: __gnu_cxx::new_allocator<basctl::Layout::SplittedSide::Item>::deallocate(basctl::Layout::SplittedSide::Item*, unsigned long) (/usr/include/c++/4.8.1/ext/new_allocator.h:110)
by 0x23DD8C77: std::__cxx1998::_Vector_base<basctl::Layout::SplittedSide::Item, std::allocator<basctl::Layout::SplittedSide::Item> >::_M_deallocate(basctl::Layout::SplittedSide::Item*, unsigned long) (/usr/include/c++/4.8.1/bits/stl_vector.h:174)
by 0x23DD7F89: std::__cxx1998::_Vector_base<basctl::Layout::SplittedSide::Item, std::allocator<basctl::Layout::SplittedSide::Item> >::~_Vector_base() (/usr/include/c++/4.8.1/bits/stl_vector.h:160)
by 0x23DD73DC: std::__cxx1998::vector<basctl::Layout::SplittedSide::Item, std::allocator<basctl::Layout::SplittedSide::Item> >::~vector() (/usr/include/c++/4.8.1/bits/stl_vector.h:416)
by 0x23DD6A05: std::__debug::vector<basctl::Layout::SplittedSide::Item, std::allocator<basctl::Layout::SplittedSide::Item> >::~vector() (/usr/include/c++/4.8.1/debug/vector:144)
by 0x23DD6889: basctl::Layout::SplittedSide::~SplittedSide() (/basctl/source/basicide/layout.hxx:80)
by 0x23DD4EF1: basctl::Layout::~Layout() (/basctl/source/basicide/layout.cxx:56)
by 0x23D89E39: basctl::DialogWindowLayout::~DialogWindowLayout() (in /data/lo/core/solver/unxlngx6/installation/opt/program/libbasctllo.so)
by 0x23D89E69: basctl::DialogWindowLayout::~DialogWindowLayout() (/basctl/source/inc/baside3.hxx:125)
by 0x23D997F3: void boost::checked_delete<basctl::DialogWindowLayout>(basctl::DialogWindowLayout*) (/workdir/unxlngx6/UnpackedTarball/boost/boost/checked_delete.hpp:34)
by 0x23D99694: boost::scoped_ptr<basctl::DialogWindowLayout>::~scoped_ptr() (/workdir/unxlngx6/UnpackedTarball/boost/boost/smart_ptr/scoped_ptr.hpp:82)
by 0x23D9A5E7: basctl::Shell::~Shell() (/basctl/source/basicide/basidesh.cxx:223)
by 0x23D9A717: basctl::Shell::~Shell() (/basctl/source/basicide/basidesh.cxx:248)
by 0x6942297: SfxViewFrame::ReleaseObjectShell_Impl() (/sfx2/source/view/viewfrm.cxx:1089)
by 0x6943BAB: SfxViewFrame::~SfxViewFrame() (/sfx2/source/view/viewfrm.cxx:1484)
by 0x6943E09: SfxViewFrame::~SfxViewFrame() (/sfx2/source/view/viewfrm.cxx:1505)
by 0x69427EC: SfxViewFrame::Close() (/sfx2/source/view/viewfrm.cxx:1144)
by 0x6919441: SfxFrame::DoClose_Impl() (/sfx2/source/view/frame.cxx:175)
by 0x6934542: SfxBaseController::dispose() (/sfx2/source/view/sfxbasecontroller.cxx:1035)
by 0x1BC8C5B3: framework::Frame::setComponent(com::sun:⭐:uno::Reference<com::sun:⭐:awt::XWindow> const&, com::sun:⭐:uno::Reference<com::sun:⭐:frame::XController> const&) (/framework/source/services/frame.cxx:1357)
by 0x1BBAF54B: framework::CloseDispatcher::implts_establishBackingMode() (/framework/source/dispatch/closedispatcher.cxx:540)
by 0x1BBAEB15: framework::CloseDispatcher::impl_asyncCallback(void*) (/framework/source/dispatch/closedispatcher.cxx:391)
by 0x1BBAE6AF: framework::CloseDispatcher::dispatchWithNotification(com::sun:⭐:util::URL const&, com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> const&, com::sun:⭐:uno::Reference<com::sun:⭐:frame::XDispatchResultListener> const&) (/framework/source/dispatch/closedispatcher.cxx:228)
by 0x23A2A71D: framework::DispatchHelper::executeDispatch(com::sun:⭐:uno::Reference<com::sun:⭐:frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> const&) (/framework/source/services/dispatchhelper.cxx:142)
by 0x1BC06442: framework::LayoutManager::MenuBarClose(void*) (/framework/source/layoutmanager/layoutmanager.cxx:2638)
by 0x1BC062F6: framework::LayoutManager::LinkStubMenuBarClose(void*, void*) (/framework/source/layoutmanager/layoutmanager.cxx:2621)
by 0x9053555: Link::Call(void*) const (/include/tools/link.hxx:123)
by 0x9610263: ImplHandleUserEvent(ImplSVEvent*) (/vcl/source/window/winproc.cxx:1975)
by 0x961173A: ImplWindowFrameProc(Window*, SalFrame*, unsigned short, void const*) (/vcl/source/window/winproc.cxx:2590)
by 0x961FCAE: SalFrame::CallCallback(unsigned short, void const*) const (in /data/lo/core/solver/unxlngx6/installation/opt/program/libvcllo.so)
by 0x961F74D: SalGenericDisplay::DispatchInternalEvent() (/vcl/generic/app/gendisp.cxx:91)
by 0x171A5821: GtkData::userEventFn(void*) (/vcl/unx/gtk/app/gtkdata.cxx:933)
by 0x171A587C: call_userEventFn (/vcl/unx/gtk/app/gtkdata.cxx:943)
by 0x3B78E47E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
by 0x3B78E48157: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
by 0x3B78E481FB: g_main_context_iteration (in /usr/lib64/libglib-2.0.so.0.3600.3)
by 0x171A47B0: GtkData::Yield(bool, bool) (/vcl/unx/gtk/app/gtkdata.cxx:574)
by 0x171A82BD: GtkInstance::Yield(bool, bool) (/vcl/unx/gtk/app/gtkinst.cxx:405)
by 0x906C838: ImplYield(bool, bool) (/vcl/source/app/svapp.cxx:417)
by 0x9068F00: Application::Yield() (/vcl/source/app/svapp.cxx:451)
by 0x9068EB0: Application::Execute() (/vcl/source/app/svapp.cxx:396)
by 0x4EC6117: desktop::Desktop::Main() (/desktop/source/app/app.cxx:1720)
by 0x9075192: ImplSVMain() (/vcl/source/app/svmain.cxx:162)
by 0x907529C: SVMain() (/vcl/source/app/svmain.cxx:198)
by 0x4F0A9C0: soffice_main (/desktop/source/app/sofficemain.cxx:81)
by 0x40096B: sal_main (/desktop/source/app/main.c:48)
by 0x40094C: main (/desktop/source/app/main.c:47)
Change-Id: If7ec0fceec6da1731df8ac389406327fbd95b382
for now only with cut, copy and paste but can be extended
Patch by: Tsutomu Uchino <hanya.runo@gmail.com>
(cherry picked from commit 82170a2180449bccb55b5091571dc79ec6fc7b51)
Conflicts:
basctl/source/basicide/baside2b.cxx
Change-Id: I2654eb073804cfe6936fa98e859800441ee34e42
If no LanguageTag instance is at hand use the static methods to convert
between BCP 47 string, Locale and MS-LangID instead of creating
temporary instances.
Change-Id: I9597f768078eb81c840e84a5db5617f26bb7dc09
object catalog when updated, updates ( all ) entries and was parsing
the source for every method in every module
Change-Id: Id68e3c24d597d29a86d3507a7dc20745c96dd2a2
object catalog when updated updates ( all ) entries and was parsing
the source for every method in every module
Change-Id: Id68e3c24d597d29a86d3507a7dc20745c96dd2a2
This reverts commit 6c61b20a8d4a6dcac28801cde82a211fb7e30654. As discussed at
<http://lists.freedesktop.org/archives/libreoffice/2013-May/052449.html> "Re:
fdo#46808, Convert awt::UnoControlDialogModel to new style problem" why the odd
change in 2e2a4827ce6708f0e8677dba9cc92e1479a44086 "scripting: get
CreateUnoDialog() work again" appears to fix things again:
The problem is that the implementation of the css.awt.UnoControlDialogModel
involves UNO aggregation
(IMPL_CREATE_INSTANCE_WITH_GEOMETRY(UnoControlDialogModel) in
toolkit/soruce/helper/registerservices.cxx creating a
OGeometryControlModel<UnoControlDialogModel> instance that aggregates a
UnoControlDialogModel instance). That means that queryInterface can return a
reference to something that is technically a different object, and that's
what's happening here, and explains why calling setPropertyValue in two
different ways on what logically appears to be a single object can end up
calling two different implementations (of two different physical objects).
(UNO aggregation is known to be broken and should not be used. Nevertheless,
there's still code that does---code that is a horrible mess and hard to clean
up.)
That all this worked as intended in the past is just sheer luck, but any
way of substantially touching it is asking for trouble. I'm going to
revert 6c61b20a8d4a6dcac28801cde82a211fb7e30654 again.
I wasn't able to revert without also reverting
be50ad28f5bbdaeff527f646481ce263843c2401 "fdo#46808, Convert
awt::XUnoControlDialog to new style," as the two were tightly dependant. Also
reverts all the follow-up fixes cb4b6dde8fda2a5848e11063028bf44d72f85431
"-Werror,-Wuninitialized" (sans the const-ness fix in
UpdateHandler::insertControlModel), 697a007c61b9cabceb9767fad87cd5822b300452
"Fix exception specifications," 2ce6828bbbf6ba181bb2276adeec279e74151ef6 "fix
awt::UnoControlModelDialog crash," and 2e2a4827ce6708f0e8677dba9cc92e1479a44086
"scripting: get CreateUnoDialog() work again."
Conflicts:
basctl/source/dlged/dlged.cxx
filter/source/t602/t602filter.cxx
xmlscript/test/imexp.cxx
Change-Id: I5d133468062f3ca36300db52fbd699be1ac72998
This service no longer exists in LO, and no-one seems to know what
this service was, so convert it to use the awt::Toolkit service,
since that service returns the interface the code expects.
Change-Id: I761effbd49a9a3a15ec9c8716c72d4220a3e987e