summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2019-08-18 23:34:32 +0800
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2019-08-19 00:35:10 +0800
commit68973ed3d9d5e125fc7142e512c10d97dd41b865 (patch)
treee7005b1b43543f06b8fdc6bb22d691e6e2055d68
parentuitest: add the SideBar implementation (diff)
downloadcore-feature/gsoc-uitest-2019.tar.gz
core-feature/gsoc-uitest-2019.zip
uitest: fixed for formatting and plugin stringconstant feature/gsoc-uitest-2019
Change-Id: Id657c19223f20d1175f9a774357e8b1f11344fdf
-rw-r--r--include/vcl/uitest/logger.hxx48
-rw-r--r--vcl/source/uitest/logger.cxx344
-rw-r--r--vcl/source/uitest/uiobject.cxx20
3 files changed, 237 insertions, 175 deletions
diff --git a/include/vcl/uitest/logger.hxx b/include/vcl/uitest/logger.hxx
index 6c8c5008541a..450285c5c247 100644
--- a/include/vcl/uitest/logger.hxx
+++ b/include/vcl/uitest/logger.hxx
@@ -15,10 +15,32 @@
#include <tools/stream.hxx>
#include <vcl/vclevent.hxx>
-namespace com { namespace sun { namespace star {
- namespace beans { struct PropertyValue; }
-} } }
-namespace com { namespace sun { namespace star { namespace uno { template <class E> class Sequence; } } } }
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace beans
+{
+struct PropertyValue;
+}
+}
+}
+}
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace uno
+{
+template <class E> class Sequence;
+}
+}
+}
+}
struct EventDescription;
class Control;
@@ -27,7 +49,6 @@ class KeyEvent;
class UITEST_DLLPUBLIC UITestLogger
{
private:
-
SvFileStream maStream;
bool mbValid;
@@ -35,29 +56,24 @@ private:
OUString app_name;
public:
-
UITestLogger();
- void logCommand(const OUString& rAction, const css::uno::Sequence<css::beans::PropertyValue>& rArgs);
+ void logCommand(const OUString& rAction,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs);
- void logAction(VclPtr<Control> const & xUIElement, VclEventId nEvent);
+ void logAction(VclPtr<Control> const& xUIElement, VclEventId nEvent);
void log(const OUString& rString);
- void logKeyInput(VclPtr<vcl::Window> const & xUIElement, const KeyEvent& rEvent);
+ void logKeyInput(VclPtr<vcl::Window> const& xUIElement, const KeyEvent& rEvent);
void logEvent(const EventDescription& rDescription);
static UITestLogger& getInstance();
- void setAppName(OUString name){
- app_name=name;
- }
-
- OUString getAppName(){
- return app_name;
- }
+ void setAppName(OUString name) { app_name = name; }
+ OUString getAppName() { return app_name; }
};
#endif
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index 0ecd673f9879..03c439fcbd7c 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -20,9 +20,9 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <memory>
-namespace{
-
-bool isDialogWindow(vcl::Window const * pWindow)
+namespace
+{
+bool isDialogWindow(vcl::Window const* pWindow)
{
WindowType nType = pWindow->GetType();
// DIALOG to MODALDIALOG
@@ -39,7 +39,7 @@ bool isDialogWindow(vcl::Window const * pWindow)
return false;
}
-bool isTopWindow(vcl::Window const * pWindow)
+bool isTopWindow(vcl::Window const* pWindow)
{
WindowType eType = pWindow->GetType();
if (eType == WindowType::FLOATINGWINDOW)
@@ -60,17 +60,16 @@ vcl::Window* get_top_parent(vcl::Window* pWindow)
return get_top_parent(pParent);
}
-
-
}
-UITestLogger::UITestLogger():
- maStream(),
- mbValid(false)
+UITestLogger::UITestLogger()
+ : maStream()
+ , mbValid(false)
{
static const char* pFile = std::getenv("LO_COLLECT_UIINFO");
if (pFile)
{
- OUString aDirPath("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/uitest/");
+ OUString aDirPath("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER
+ "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/uitest/");
rtl::Bootstrap::expandMacros(aDirPath);
osl::Directory::createPath(aDirPath);
OUString aFilePath = aDirPath + OUString::fromUtf8(pFile);
@@ -80,7 +79,8 @@ UITestLogger::UITestLogger():
}
}
-void UITestLogger::logCommand(const OUString& rAction, const css::uno::Sequence< css::beans::PropertyValue >& rArgs)
+void UITestLogger::logCommand(const OUString& rAction,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs)
{
if (!mbValid)
return;
@@ -126,10 +126,10 @@ void UITestLogger::logCommand(const OUString& rAction, const css::uno::Sequence<
maStream.WriteLine(OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8));
}
-namespace {
-
+namespace
+{
// most likely this should be recursive
-bool child_windows_have_focus(VclPtr<vcl::Window> const & xUIElement)
+bool child_windows_have_focus(VclPtr<vcl::Window> const& xUIElement)
{
sal_Int32 nCount = xUIElement->GetChildCount();
for (sal_Int32 i = 0; i < nCount; ++i)
@@ -144,10 +144,9 @@ bool child_windows_have_focus(VclPtr<vcl::Window> const & xUIElement)
}
return false;
}
-
}
-void UITestLogger::logAction(VclPtr<Control> const & xUIElement, VclEventId nEvent)
+void UITestLogger::logAction(VclPtr<Control> const& xUIElement, VclEventId nEvent)
{
if (!mbValid)
return;
@@ -177,14 +176,14 @@ void UITestLogger::log(const OUString& rString)
maStream.WriteLine(OUStringToOString(rString, RTL_TEXTENCODING_UTF8));
}
-void UITestLogger::logKeyInput(VclPtr<vcl::Window> const & xUIElement, const KeyEvent& rEvent)
+void UITestLogger::logKeyInput(VclPtr<vcl::Window> const& xUIElement, const KeyEvent& rEvent)
{
if (!mbValid)
return;
//We need to check for Parent's ID in case the UI Element is SubEdit of Combobox/SpinField
- const OUString& rID = xUIElement->get_id().isEmpty() ?
- xUIElement->GetParent()->get_id() : xUIElement->get_id();
+ const OUString& rID
+ = xUIElement->get_id().isEmpty() ? xUIElement->GetParent()->get_id() : xUIElement->get_id();
if (rID.isEmpty())
return;
@@ -195,22 +194,12 @@ void UITestLogger::logKeyInput(VclPtr<vcl::Window> const & xUIElement, const Key
bool bMod2 = rEvent.GetKeyCode().IsMod2();
bool bMod3 = rEvent.GetKeyCode().IsMod3();
- std::map<OUString, sal_uInt16> aKeyMap = {
- {"ESC", KEY_ESCAPE},
- {"TAB", KEY_TAB},
- {"DOWN", KEY_DOWN},
- {"UP", KEY_UP},
- {"LEFT", KEY_LEFT},
- {"RIGHT", KEY_RIGHT},
- {"DELETE", KEY_DELETE},
- {"INSERT", KEY_INSERT},
- {"BACKSPACE", KEY_BACKSPACE},
- {"RETURN", KEY_RETURN},
- {"HOME", KEY_HOME},
- {"END", KEY_END},
- {"PAGEUP", KEY_PAGEUP},
- {"PAGEDOWN", KEY_PAGEDOWN}
- };
+ std::map<OUString, sal_uInt16> aKeyMap
+ = { { "ESC", KEY_ESCAPE }, { "TAB", KEY_TAB }, { "DOWN", KEY_DOWN },
+ { "UP", KEY_UP }, { "LEFT", KEY_LEFT }, { "RIGHT", KEY_RIGHT },
+ { "DELETE", KEY_DELETE }, { "INSERT", KEY_INSERT }, { "BACKSPACE", KEY_BACKSPACE },
+ { "RETURN", KEY_RETURN }, { "HOME", KEY_HOME }, { "END", KEY_END },
+ { "PAGEUP", KEY_PAGEUP }, { "PAGEDOWN", KEY_PAGEDOWN } };
OUString aFound;
for (auto& itr : aKeyMap)
@@ -247,7 +236,7 @@ void UITestLogger::logKeyInput(VclPtr<vcl::Window> const & xUIElement, const Key
std::unique_ptr<UIObject> pUIObject = xUIElement->GetUITestFactory()(xUIElement.get());
- VclPtr <vcl::Window> pParent = xUIElement->GetParent();
+ VclPtr<vcl::Window> pParent = xUIElement->GetParent();
while (!pParent->IsTopWindow())
{
@@ -258,52 +247,63 @@ void UITestLogger::logKeyInput(VclPtr<vcl::Window> const & xUIElement, const Key
OUString aContent;
- if(pUIObject->get_type()=="EditUIObject"){
- if(aParentID=="")
+ if (pUIObject->get_type() == "EditUIObject")
+ {
+ if (aParentID.isEmpty())
{
- VclPtr <vcl::Window> pParent_top = get_top_parent(xUIElement);
- aParentID= pParent_top->get_id();
+ VclPtr<vcl::Window> pParent_top = get_top_parent(xUIElement);
+ aParentID = pParent_top->get_id();
}
- if(aParentID==""){
- aContent = aContent+"Type on '" + rID + "' " + aKeyCode;
+ if (aParentID.isEmpty())
+ {
+ aContent = aContent + "Type on '" + rID + "' " + aKeyCode;
}
- else{
- aContent = aContent+"Type on '" + rID + "' " + aKeyCode + " from " + aParentID ;
+ else
+ {
+ aContent = aContent + "Type on '" + rID + "' " + aKeyCode + " from " + aParentID;
}
}
- else if(pUIObject->get_type()=="SwEditWinUIObject" && rID=="writer_edit"){
- aContent = "Type on writer " + aKeyCode ;
+ else if (pUIObject->get_type() == "SwEditWinUIObject" && rID == "writer_edit")
+ {
+ aContent = "Type on writer " + aKeyCode;
}
- else if(pUIObject->get_type()=="ScGridWinUIObject" && rID=="grid_window"){
- aContent = "Type on current cell " + aKeyCode ;
+ else if (pUIObject->get_type() == "ScGridWinUIObject" && rID == "grid_window")
+ {
+ aContent = "Type on current cell " + aKeyCode;
}
- else if(pUIObject->get_type()=="ImpressWindowUIObject" && rID=="impress_win"){
- aContent = "Type on impress " + aKeyCode ;
+ else if (pUIObject->get_type() == "ImpressWindowUIObject" && rID == "impress_win")
+ {
+ aContent = "Type on impress " + aKeyCode;
}
- else if(pUIObject->get_type()=="WindowUIObject" && rID=="math_edit"){
- aContent = "Type on math " + aKeyCode ;
+ else if (pUIObject->get_type() == "WindowUIObject" && rID == "math_edit")
+ {
+ aContent = "Type on math " + aKeyCode;
}
- else if(rID=="draw_win"){
- aContent = "Type on draw " + aKeyCode ;
+ else if (rID == "draw_win")
+ {
+ aContent = "Type on draw " + aKeyCode;
}
- else{
- if(aParentID=="")
+ else
+ {
+ if (aParentID.isEmpty())
{
- VclPtr <vcl::Window> pParent_top = get_top_parent(xUIElement);
- aParentID= pParent_top->get_id();
+ VclPtr<vcl::Window> pParent_top = get_top_parent(xUIElement);
+ aParentID = pParent_top->get_id();
}
- if(aParentID==""){
- aContent = "Type on '" + rID + "' " + aKeyCode ;
+ if (aParentID.isEmpty())
+ {
+ aContent = "Type on '" + rID + "' " + aKeyCode;
}
- else{
- aContent = "Type on '" + rID + "' " + aKeyCode + " from " + aParentID ;
+ else
+ {
+ aContent = "Type on '" + rID + "' " + aKeyCode + " from " + aParentID;
}
}
maStream.WriteLine(OUStringToOString(aContent, RTL_TEXTENCODING_UTF8));
}
-namespace {
-
+namespace
+{
OUString StringMapToOUString(const std::map<OUString, OUString>& rParameters)
{
if (rParameters.empty())
@@ -312,11 +312,15 @@ OUString StringMapToOUString(const std::map<OUString, OUString>& rParameters)
OUStringBuffer aParameterString = " {";
for (std::map<OUString, OUString>::const_iterator itr = rParameters.begin();
- itr != rParameters.end(); ++itr)
+ itr != rParameters.end(); ++itr)
{
if (itr != rParameters.begin())
aParameterString.append(", ");
- aParameterString.append("\"").append(itr->first).append("\": \"").append(itr->second).append("\"");
+ aParameterString.append("\"")
+ .append(itr->first)
+ .append("\": \"")
+ .append(itr->second)
+ .append("\"");
}
aParameterString.append("}");
@@ -324,29 +328,29 @@ OUString StringMapToOUString(const std::map<OUString, OUString>& rParameters)
return aParameterString.makeStringAndClear();
}
-OUString GetValueInMapWithIndex(const std::map<OUString, OUString>& rParameters,sal_Int32 index)
+OUString GetValueInMapWithIndex(const std::map<OUString, OUString>& rParameters, sal_Int32 index)
{
- sal_Int32 j=0;
+ sal_Int32 j = 0;
std::map<OUString, OUString>::const_iterator itr = rParameters.begin();
- for ( ; itr != rParameters.end() && j<index ; ++itr,++j);
+ for (; itr != rParameters.end() && j < index; ++itr, ++j)
+ ;
return itr->second;
}
-
-OUString GetKeyInMapWithIndex(const std::map<OUString, OUString>& rParameters,sal_Int32 index)
+OUString GetKeyInMapWithIndex(const std::map<OUString, OUString>& rParameters, sal_Int32 index)
{
- sal_Int32 j=0;
+ sal_Int32 j = 0;
std::map<OUString, OUString>::const_iterator itr = rParameters.begin();
- for ( ; itr != rParameters.end() && j<index ; ++itr,++j);
+ for (; itr != rParameters.end() && j < index; ++itr, ++j)
+ ;
return itr->first;
}
-
}
void UITestLogger::logEvent(const EventDescription& rDescription)
@@ -354,138 +358,181 @@ void UITestLogger::logEvent(const EventDescription& rDescription)
OUString aParameterString = StringMapToOUString(rDescription.aParameters);
//here we will customize our statments depending on the caller of this function
- OUString aLogLine ;
+ OUString aLogLine;
//first check on general commands
- if(rDescription.aAction=="SET"){
- aLogLine = "Set Zoom to " + GetValueInMapWithIndex(rDescription.aParameters,0);
+ if (rDescription.aAction == "SET")
+ {
+ aLogLine = "Set Zoom to " + GetValueInMapWithIndex(rDescription.aParameters, 0);
}
- else if(rDescription.aAction=="SIDEBAR"){
+ else if (rDescription.aAction == "SIDEBAR")
+ {
aLogLine = "From SIDEBAR Choose " + aParameterString;
}
- else if(rDescription.aAction=="SELECT" && rDescription.aID==""){
+ else if (rDescription.aAction == "SELECT" && rDescription.aID.isEmpty())
+ {
aLogLine = "Select " + aParameterString;
}
- else if(rDescription.aID=="writer_edit"){
- if(rDescription.aAction=="GOTO"){
- aLogLine = "GOTO page number " + GetValueInMapWithIndex(rDescription.aParameters,0);
+ else if (rDescription.aID == "writer_edit")
+ {
+ if (rDescription.aAction == "GOTO")
+ {
+ aLogLine = "GOTO page number " + GetValueInMapWithIndex(rDescription.aParameters, 0);
}
- else if(rDescription.aAction=="SELECT"){
- OUString to = GetValueInMapWithIndex(rDescription.aParameters,0);
- OUString from = GetValueInMapWithIndex(rDescription.aParameters,1);
- aLogLine = "Select from Pos " + from + " to Pos " + to ;
+ else if (rDescription.aAction == "SELECT")
+ {
+ OUString to = GetValueInMapWithIndex(rDescription.aParameters, 0);
+ OUString from = GetValueInMapWithIndex(rDescription.aParameters, 1);
+ aLogLine = "Select from Pos " + from + " to Pos " + to;
}
- else if(rDescription.aAction=="CREATE_TABLE"){
- OUString size = GetValueInMapWithIndex(rDescription.aParameters,0);
- aLogLine = "Create Table with " + size; ;
+ else if (rDescription.aAction == "CREATE_TABLE")
+ {
+ OUString size = GetValueInMapWithIndex(rDescription.aParameters, 0);
+ aLogLine = "Create Table with " + size;
+ ;
}
- else if(rDescription.aAction=="COPY"){
- aLogLine = "Copy the Selected Text";
+ else if (rDescription.aAction == "COPY")
+ {
+ aLogLine = "Copy the Selected Text";
}
- else if(rDescription.aAction=="CUT"){
- aLogLine = "Cut the Selected Text";
+ else if (rDescription.aAction == "CUT")
+ {
+ aLogLine = "Cut the Selected Text";
}
- else if(rDescription.aAction=="PASTE"){
- aLogLine = "Paste in the Current Cursor Location";
+ else if (rDescription.aAction == "PASTE")
+ {
+ aLogLine = "Paste in the Current Cursor Location";
}
- else if(rDescription.aAction=="BREAK_PAGE"){
- aLogLine = "Insert Break Page";
+ else if (rDescription.aAction == "BREAK_PAGE")
+ {
+ aLogLine = "Insert Break Page";
}
}
- else if(rDescription.aID=="grid_window"){
-
- if(rDescription.aAction=="SELECT"){
- OUString type = GetKeyInMapWithIndex(rDescription.aParameters,0);
- if(type=="CELL" || type=="RANGE"){
- aLogLine = "Select from calc" + aParameterString ;
+ else if (rDescription.aID == "grid_window")
+ {
+ if (rDescription.aAction == "SELECT")
+ {
+ OUString type = GetKeyInMapWithIndex(rDescription.aParameters, 0);
+ if (type == "CELL" || type == "RANGE")
+ {
+ aLogLine = "Select from calc" + aParameterString;
}
- else if(type=="TABLE")
+ else if (type == "TABLE")
{
- aLogLine = "Switch to sheet number " + GetValueInMapWithIndex(rDescription.aParameters,0) ;
+ aLogLine = "Switch to sheet number "
+ + GetValueInMapWithIndex(rDescription.aParameters, 0);
}
}
- else if(rDescription.aAction=="LAUNCH"){
- aLogLine = "Lanuch AutoFilter from Col "+
- GetValueInMapWithIndex(rDescription.aParameters,2) +
- " and Row " + GetValueInMapWithIndex(rDescription.aParameters,1);
+ else if (rDescription.aAction == "LAUNCH")
+ {
+ aLogLine = "Lanuch AutoFilter from Col "
+ + GetValueInMapWithIndex(rDescription.aParameters, 2) + " and Row "
+ + GetValueInMapWithIndex(rDescription.aParameters, 1);
}
- else if(rDescription.aAction=="DELETE_CONTENT"){
+ else if (rDescription.aAction == "DELETE_CONTENT")
+ {
aLogLine = "Remove Content from This " + aParameterString;
}
- else if(rDescription.aAction=="DELETE_CELLS"){
+ else if (rDescription.aAction == "DELETE_CELLS")
+ {
aLogLine = "Delete The Cells in" + aParameterString;
}
- else if(rDescription.aAction=="INSERT_CELLS"){
+ else if (rDescription.aAction == "INSERT_CELLS")
+ {
aLogLine = "Insert Cell around the " + aParameterString;
}
- else if(rDescription.aAction=="CUT"){
+ else if (rDescription.aAction == "CUT")
+ {
aLogLine = "CUT the selected " + aParameterString;
}
- else if(rDescription.aAction=="COPY"){
+ else if (rDescription.aAction == "COPY")
+ {
aLogLine = "COPY the selected " + aParameterString;
}
- else if(rDescription.aAction=="PASTE"){
+ else if (rDescription.aAction == "PASTE")
+ {
aLogLine = "Paste in the " + aParameterString;
}
- else if(rDescription.aAction=="MERGE_CELLS"){
+ else if (rDescription.aAction == "MERGE_CELLS")
+ {
aLogLine = "Merge " + aParameterString;
}
- else if(rDescription.aAction=="UNMERGE_CELL"){
+ else if (rDescription.aAction == "UNMERGE_CELL")
+ {
aLogLine = "Delete the merged " + aParameterString;
}
- else if(rDescription.aAction=="Rename_Sheet"){
- aLogLine = "Rename The Selected Tab to \""+\
- GetValueInMapWithIndex(rDescription.aParameters,0)+"\"";
+ else if (rDescription.aAction == "Rename_Sheet")
+ {
+ aLogLine = "Rename The Selected Tab to \""
+ + GetValueInMapWithIndex(rDescription.aParameters, 0) + "\"";
}
- else if(rDescription.aAction=="InsertTab"){
+ else if (rDescription.aAction == "InsertTab")
+ {
aLogLine = "Insert New Tab ";
}
}
- else if(rDescription.aID=="impress_win_or_draw_win"){
- if(rDescription.aAction=="Insert_New_Page_or_Slide"){
- if(UITestLogger::getInstance().getAppName()=="impress"){
- aLogLine = "Insert New Slide at Position " + GetValueInMapWithIndex(rDescription.aParameters,0);
+ else if (rDescription.aID == "impress_win_or_draw_win")
+ {
+ if (rDescription.aAction == "Insert_New_Page_or_Slide")
+ {
+ if (UITestLogger::getInstance().getAppName() == "impress")
+ {
+ aLogLine = "Insert New Slide at Position "
+ + GetValueInMapWithIndex(rDescription.aParameters, 0);
}
- else if(UITestLogger::getInstance().getAppName()=="draw"){
- aLogLine = "Insert New Page at Position " + GetValueInMapWithIndex(rDescription.aParameters,0);
+ else if (UITestLogger::getInstance().getAppName() == "draw")
+ {
+ aLogLine = "Insert New Page at Position "
+ + GetValueInMapWithIndex(rDescription.aParameters, 0);
}
}
- else if(rDescription.aAction=="Delete_Slide_or_Page"){
- if(UITestLogger::getInstance().getAppName()=="impress"){
- aLogLine = "Delete Slide number "+ GetValueInMapWithIndex(rDescription.aParameters,0);
+ else if (rDescription.aAction == "Delete_Slide_or_Page")
+ {
+ if (UITestLogger::getInstance().getAppName() == "impress")
+ {
+ aLogLine
+ = "Delete Slide number " + GetValueInMapWithIndex(rDescription.aParameters, 0);
}
- else if(UITestLogger::getInstance().getAppName()=="draw"){
- aLogLine = "Delete Page number "+ GetValueInMapWithIndex(rDescription.aParameters,0);
+ else if (UITestLogger::getInstance().getAppName() == "draw")
+ {
+ aLogLine
+ = "Delete Page number " + GetValueInMapWithIndex(rDescription.aParameters, 0);
}
}
- else if(rDescription.aAction=="Duplicate"){
+ else if (rDescription.aAction == "Duplicate")
+ {
aLogLine = "Duplicate The Selected Slide ";
}
- else if(rDescription.aAction=="RENAME"){
- if(UITestLogger::getInstance().getAppName()=="impress"){
- aLogLine = "Rename The Selected Slide from \""+ GetValueInMapWithIndex(rDescription.aParameters,1)+\
- "\" to \"" + GetValueInMapWithIndex(rDescription.aParameters,0)+"\"";
+ else if (rDescription.aAction == "RENAME")
+ {
+ if (UITestLogger::getInstance().getAppName() == "impress")
+ {
+ aLogLine = "Rename The Selected Slide from \""
+ + GetValueInMapWithIndex(rDescription.aParameters, 1) + "\" to \""
+ + GetValueInMapWithIndex(rDescription.aParameters, 0) + "\"";
}
- else if(UITestLogger::getInstance().getAppName()=="draw"){
- aLogLine = "Rename The Selected Page from \""+ GetValueInMapWithIndex(rDescription.aParameters,1)+\
- "\" to \"" + GetValueInMapWithIndex(rDescription.aParameters,0)+"\"";
+ else if (UITestLogger::getInstance().getAppName() == "draw")
+ {
+ aLogLine = "Rename The Selected Page from \""
+ + GetValueInMapWithIndex(rDescription.aParameters, 1) + "\" to \""
+ + GetValueInMapWithIndex(rDescription.aParameters, 0) + "\"";
}
}
}
- else if(rDescription.aParent=="element_selector"){
- aLogLine ="Select element no " + rDescription.aID +
- " From " + rDescription.aParent;
+ else if (rDescription.aParent == "element_selector")
+ {
+ aLogLine = "Select element no " + rDescription.aID + " From " + rDescription.aParent;
}
- else{
- aLogLine = rDescription.aKeyWord + " Action:" +
- rDescription.aAction + " Id:" + rDescription.aID +
- " Parent:" + rDescription.aParent + aParameterString;
+ else
+ {
+ aLogLine = rDescription.aKeyWord + " Action:" + rDescription.aAction + " Id:"
+ + rDescription.aID + " Parent:" + rDescription.aParent + aParameterString;
}
log(aLogLine);
}
UITestLogger& UITestLogger::getInstance()
{
- ImplSVData *const pSVData = ImplGetSVData();
+ ImplSVData* const pSVData = ImplGetSVData();
assert(pSVData);
if (!pSVData->maWinData.m_pUITestLogger)
@@ -496,5 +543,4 @@ UITestLogger& UITestLogger::getInstance()
return *pSVData->maWinData.m_pUITestLogger;
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index d26072cd05a9..59510d6c03c8 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -622,7 +622,7 @@ OUString ButtonUIObject::get_action(VclEventId nEvent) const
return "Start database" ;
}
else{
- if (get_top_parent(mxButton)->get_id()==""){
+ if (get_top_parent(mxButton)->get_id().isEmpty()){
//This part because if we don't have parent
return "Click on '" + mxButton->get_id() ;
}
@@ -751,7 +751,7 @@ OUString EditUIObject::get_action(VclEventId nEvent) const
const Selection& rSelection = mxEdit->GetSelection();
long nMin = rSelection.Min();
long nMax = rSelection.Max();
- if(get_top_parent(mxEdit)->get_id()==""){
+ if(get_top_parent(mxEdit)->get_id().isEmpty()){
//This part because if we don't have parent
return "Select in '" +
mxEdit->get_id() +
@@ -880,7 +880,7 @@ OUString CheckBoxUIObject::get_action(VclEventId nEvent) const
{
if (nEvent == VclEventId::CheckboxToggle)
{
- if(get_top_parent(mxCheckBox)->get_id()==""){
+ if(get_top_parent(mxCheckBox)->get_id().isEmpty()){
//This part because if we don't have parent
return "Toggle '" + mxCheckBox->get_id() + "' CheckBox";
}
@@ -934,7 +934,7 @@ OUString RadioButtonUIObject::get_action(VclEventId nEvent) const
{
if (nEvent == VclEventId::RadiobuttonToggle)
{
- if(get_top_parent(mxRadioButton)->get_id()==""){
+ if(get_top_parent(mxRadioButton)->get_id().isEmpty()){
//This part because if we don't have parent
return "Select '" + mxRadioButton->get_id() + "' RadioButton";
}
@@ -1044,7 +1044,7 @@ OUString ListBoxUIObject::get_action(VclEventId nEvent) const
if (nEvent == VclEventId::ListboxSelect)
{
sal_Int32 nPos = mxListBox->GetSelectedEntryPos();
- if(get_top_parent(mxListBox)->get_id()==""){
+ if(get_top_parent(mxListBox)->get_id().isEmpty()){
//This part because if we don't have parent
return "Select element with position " + OUString::number(nPos) +
" in '" + mxListBox->get_id();
@@ -1054,7 +1054,7 @@ OUString ListBoxUIObject::get_action(VclEventId nEvent) const
}
else if (nEvent == VclEventId::ListboxFocus)
{
- if(get_top_parent(mxListBox)->get_id()=="")
+ if(get_top_parent(mxListBox)->get_id().isEmpty())
{
//This part because if we don't have parent
return this->get_type() + " Action:FOCUS Id:" + mxListBox->get_id();
@@ -1129,7 +1129,7 @@ OUString ComboBoxUIObject::get_action(VclEventId nEvent) const
if (nEvent == VclEventId::ComboboxSelect)
{
sal_Int32 nPos = mxComboBox->GetSelectedEntryPos();
- if (get_top_parent(mxComboBox)->get_id()==""){
+ if (get_top_parent(mxComboBox)->get_id().isEmpty()){
//This part because if we don't have parent
return "Select in '" + mxComboBox->get_id() +
"' ComboBox item number " + OUString::number(nPos);
@@ -1249,7 +1249,7 @@ OUString SpinFieldUIObject::get_action(VclEventId nEvent) const
{
if (nEvent == VclEventId::SpinfieldUp)
{
- if(get_top_parent(mxSpinField)->get_id()=="")
+ if(get_top_parent(mxSpinField)->get_id().isEmpty())
{
//This part because if we don't have parent
return "Increase '" + mxSpinField->get_id();
@@ -1259,7 +1259,7 @@ OUString SpinFieldUIObject::get_action(VclEventId nEvent) const
}
else if (nEvent == VclEventId::SpinfieldDown)
{
- if(get_top_parent(mxSpinField)->get_id()=="")
+ if(get_top_parent(mxSpinField)->get_id().isEmpty())
{
//This part because if we don't have parent
return "Decrease '" + mxSpinField->get_id();
@@ -1328,7 +1328,7 @@ OUString TabControlUIObject::get_action(VclEventId nEvent) const
{
sal_Int32 nPageId = mxTabControl->GetCurPageId();
- if(get_top_parent(mxTabControl)->get_id()==""){
+ if(get_top_parent(mxTabControl)->get_id().isEmpty()){
//This part because if we don't have parent
return "Choose Tab number " + OUString::number(mxTabControl->GetPagePos(nPageId)) +
" in '" + mxTabControl->get_id();