drop isLOKMobilePhone

follow-up of
commit 8b90f2cd18
Author: Heiko Tietze <tietze.heiko@gmail.com>
Date:   Thu May 28 09:05:55 2026 +0200

    Remove wordcount-mobile dialog

This commit also reverts
commit 5eec86d6c4
Author: Caolán McNamara <caolan.mcnamara@collabora.com>
Date:   Tue May 6 16:38:57 2025 +0100

    no searchicon (or searchbox) in mobile version of search dialog

Change-Id: I7dd37f5e6575f2f1b7748ce6c1bd6ddadb8c3e77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205826
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2026-05-29 13:38:32 +02:00
parent 7312d7d3c9
commit f436c1cd89
41 changed files with 50 additions and 1457 deletions
@@ -884,7 +884,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
void ChartController::execute_DoubleClick( const Point* pMousePixel, bool &bEditText )
{
const SfxViewShell* pViewShell = SfxViewShell::Current();
bool notAllowed = pViewShell && (pViewShell->isLOKMobilePhone() || pViewShell->IsLokReadOnlyView());
bool notAllowed = pViewShell && (pViewShell->IsLokReadOnlyView());
if (notAllowed)
return;
+1 -4
View File
@@ -119,8 +119,7 @@ enum class LOKDeviceFormFactor
{
UNKNOWN = 0,
DESKTOP = 1,
TABLET = 2,
MOBILE = 3
TABLET = 2
};
class SfxViewFactory;
@@ -479,8 +478,6 @@ public:
bool isLOKDesktop() const { return maLOKDeviceFormFactor == LOKDeviceFormFactor::DESKTOP; }
/// Check if the lok client is running on a tablet.
bool isLOKTablet() const { return maLOKDeviceFormFactor == LOKDeviceFormFactor::TABLET; }
/// Check if the lok client is running on a mobile device.
bool isLOKMobilePhone() const { return maLOKDeviceFormFactor == LOKDeviceFormFactor::MOBILE; }
virtual tools::Rectangle getLOKVisibleArea() const { return tools::Rectangle(); }
+1 -1
View File
@@ -25,7 +25,7 @@ class VCL_DLLPUBLIC BuilderPage
{
public:
BuilderPage(weld::Widget* pParent, weld::DialogController* pController,
const OUString& rUIXMLDescription, const OUString& rID, bool bIsMobile = false);
const OUString& rUIXMLDescription, const OUString& rID);
virtual ~BuilderPage();
/* The title of the page, in an Assistant the dialog may append this page title to the
+1 -1
View File
@@ -1333,7 +1333,7 @@ public:
// For vclbootstrapprotector:
static void setDeInitHook(Link<LinkParamNone*,void> const & hook);
static std::unique_ptr<weld::Builder> CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, bool bMobile = false, sal_uInt64 nLOKWindowId = 0);
static std::unique_ptr<weld::Builder> CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, sal_uInt64 nLOKWindowId = 0);
// For the duration of vcl parent windows
static std::unique_ptr<weld::Builder> CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId = 0);
+1 -1
View File
@@ -49,7 +49,7 @@ protected:
public:
GenericDialogController(weld::Widget* pParent, const OUString& rUIFile,
const OUString& rDialogId, bool bMobile = false);
const OUString& rDialogId);
virtual Dialog* getDialog() override;
virtual ~GenericDialogController() override;
};
-7
View File
@@ -196,10 +196,7 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const SfxBindings* pBind ) :
InsertItem (SID_INPUT_FUNCTION, Image(StockImage::Yes, RID_BMP_INPUT_FUNCTION), ToolBoxItemBits::NONE, 2);
}
const bool bIsLOKMobilePhone = mpViewShell && mpViewShell->isLOKMobilePhone();
// sigma and equal buttons
if (!bIsLOKMobilePhone)
{
InsertItem (SID_INPUT_SUM, Image(StockImage::Yes, RID_BMP_INPUT_SUM), ToolBoxItemBits::DROPDOWN, 3);
InsertItem (SID_INPUT_EQUAL, Image(StockImage::Yes, RID_BMP_INPUT_EQUAL), ToolBoxItemBits::NONE, 4);
@@ -224,7 +221,6 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const SfxBindings* pBind ) :
}
// sigma and equal buttons
if (!bIsLOKMobilePhone)
{
SetHelpId (SID_INPUT_SUM, HID_INSWIN_SUM);
SetHelpId (SID_INPUT_EQUAL, HID_INSWIN_FUNC);
@@ -883,9 +879,6 @@ ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, ScTabViewShell* pViewSh)
mxButtonUp->set_size_request(-1, nHeight);
mxButtonDown->set_size_request(-1, nHeight);
// disable the multiline toggle on the mobile phones
const SfxViewShell* pViewShell = SfxViewShell::Current();
if (!comphelper::LibreOfficeKit::isActive() || !(pViewShell && pViewShell->isLOKMobilePhone()))
mxButtonDown->show();
// tdf#154042 Use an initial height of one row so the Toolbar positions
+1 -7
View File
@@ -420,17 +420,11 @@ IMPL_LINK( ScCondFormatList, EntrySelectHdl, ScCondFrmtEntry&, rEntry, void )
RecalcAll();
}
static bool isLOKMobilePhone()
{
SfxViewShell* pCurrent = SfxViewShell::Current();
return pCurrent && pCurrent->isLOKMobilePhone();
}
ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW,
weld::Window* pParent, ScViewData& rViewData,
const std::shared_ptr<ScCondFormatDlgData>& rItem)
: ScAnyRefDlgController(pB, pCW, pParent,
isLOKMobilePhone()?u"modules/scalc/ui/conditionalformatdialogmobile.ui"_ustr:u"modules/scalc/ui/conditionalformatdialog.ui"_ustr,
u"modules/scalc/ui/conditionalformatdialog.ui"_ustr,
u"ConditionalFormatDialog"_ustr)
, mrViewData(rViewData)
// previous version based on SfxPoolItem used SfxPoolItem::Clone here, so make a copy
@@ -46,15 +46,9 @@
// force them to take a 1/3 of the available space
#define CommonWidgetWidth 10
static bool isLOKMobilePhone()
{
SfxViewShell* pCurrent = SfxViewShell::Current();
return pCurrent && pCurrent->isLOKMobilePhone();
}
ScCondFrmtEntry::ScCondFrmtEntry(ScCondFormatList* pParent, ScDocument& rDoc, const ScAddress& rPos)
: mpParent(pParent)
, mxBuilder(Application::CreateBuilder(pParent->GetGrid(), isLOKMobilePhone()?u"modules/scalc/ui/conditionalentrymobile.ui"_ustr:u"modules/scalc/ui/conditionalentry.ui"_ustr))
, mxBuilder(Application::CreateBuilder(pParent->GetGrid(), u"modules/scalc/ui/conditionalentry.ui"_ustr))
, mxBorder(mxBuilder->weld_widget(u"border"_ustr))
, mxGrid(mxBuilder->weld_container(u"grid"_ustr))
, mxFtCondNr(mxBuilder->weld_label(u"number"_ustr))
-14
View File
@@ -81,14 +81,6 @@ const WhichRangesContainer ScTPValidationValue::pValueRanges(svl::Items<
FID_VALID_MODE, FID_VALID_ERRTEXT
>);
static bool isLOKMobilePhone()
{
if (!comphelper::LibreOfficeKit::isActive())
return false;
SfxViewShell* pViewShell = SfxViewShell::Current();
return pViewShell && pViewShell->isLOKMobilePhone();
}
ScValidationDlg::ScValidationDlg(weld::Window* pParent, const SfxItemSet* pArgSet,
ScTabViewShell *pTabViewSh)
: ScValidationDlgBase(pParent,
@@ -105,12 +97,6 @@ ScValidationDlg::ScValidationDlg(weld::Window* pParent, const SfxItemSet* pArgSe
ScTPValidationHelp::Create, RID_L + RID_TAB_VALIDITY_INPUT.sIconName);
AddTabPage(u"erroralert"_ustr, TabResId(RID_TAB_VALIDITY_ERROR.aLabel),
ScTPValidationError::Create, RID_L + RID_TAB_VALIDITY_ERROR.sIconName);
if (isLOKMobilePhone())
{
m_xBuilder->weld_button(u"cancel"_ustr)->hide();
m_xBuilder->weld_button(u"help"_ustr)->hide();
}
}
void ScValidationDlg::EndDialog(int nResponse)
-9
View File
@@ -271,15 +271,6 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
bool isMobilePhone = comphelper::LibreOfficeKit::isActive() && rViewShell.isLOKMobilePhone();
// Double tapping on charts on phone may result in activating the edit mode which is not wanted.
// It happens due to the delay of selection message of the object from kit to javascript
// in that case F2 is sent instead of double click
if (isMobilePhone && ScDocument::IsChart(pObj))
{
rViewShell.ActivateObject(static_cast<SdrOle2Obj*>(pObj), css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY);
break;
}
if ( lcl_KeyEditMode( pObj, rViewShell, nullptr ) ) // start text edit for suitable object
bReturn = true;
}
+1 -1
View File
@@ -627,7 +627,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
if( xChartModel.is() )
xChartModel->unlockControllers();
}
else if (!rViewSh.isLOKMobilePhone())
else
{
//the controller will be unlocked by the dialog when the dialog is told to do so
-109
View File
@@ -58,103 +58,6 @@
using sc::TwipsToEvenHMM;
namespace
{
/// Rid ourselves of unwanted " quoted json characters.
OString escapeJSON(const OUString &aStr)
{
OUString aEscaped = aStr;
aEscaped = aEscaped.replaceAll("\n", " ");
aEscaped = aEscaped.replaceAll("\"", "'");
return OUStringToOString(aEscaped, RTL_TEXTENCODING_UTF8);
}
void lcl_lokGetWholeFunctionList()
{
const SfxViewShell* pViewShell = SfxViewShell::Current();
if (!(comphelper::LibreOfficeKit::isActive()
&& pViewShell && pViewShell->isLOKMobilePhone()))
return;
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
sal_uInt32 nListCount = pFuncList->GetCount();
std::set<OUString> aFuncNameOrderedSet;
for(sal_uInt32 i = 0; i < nListCount; ++i)
{
const ScFuncDesc* pDesc = pFuncList->GetFunction( i );
if ( pDesc->mxFuncName )
{
aFuncNameOrderedSet.insert(*pDesc->mxFuncName);
}
}
ScFunctionMgr* pFuncManager = ScGlobal::GetStarCalcFunctionMgr();
if (!(pFuncManager && aFuncNameOrderedSet.size()))
return;
OStringBuffer aPayload(
"{ \"wholeList\": true, "
"\"categories\": [ ");
formula::FormulaHelper aHelper(pFuncManager);
sal_uInt32 nCategoryCount = pFuncManager->getCount();
for (sal_uInt32 i = 0; i < nCategoryCount; ++i)
{
OUString sCategoryName = ScFunctionMgr::GetCategoryName(i);
aPayload.append("{"
"\"name\": \""
+ escapeJSON(sCategoryName)
+ "\"}, ");
}
sal_Int32 nLen = aPayload.getLength();
aPayload[nLen - 2] = ' ';
aPayload[nLen - 1] = ']';
aPayload.append(", ");
OUString aDescFuncNameStr;
aPayload.append("\"functions\": [ ");
sal_uInt32 nCurIndex = 0;
for (const OUString& aFuncNameStr : aFuncNameOrderedSet)
{
aDescFuncNameStr = aFuncNameStr + "()";
sal_Int32 nNextFStart = 0;
const formula::IFunctionDescription* ppFDesc;
::std::vector< OUString > aArgs;
OUString eqPlusFuncName = "=" + aDescFuncNameStr;
if ( aHelper.GetNextFunc( eqPlusFuncName, false, nNextFStart, nullptr, &ppFDesc, &aArgs ) )
{
if ( ppFDesc && !ppFDesc->getFunctionName().isEmpty() )
{
if (ppFDesc->getCategory())
{
aPayload.append("{"
"\"index\": "
+ OString::number(static_cast<sal_Int64>(nCurIndex))
+ ", "
"\"category\": "
+ OString::number(static_cast<sal_Int64>(ppFDesc->getCategory()->getNumber()))
+ ", "
"\"signature\": \""
+ escapeJSON(ppFDesc->getSignature())
+ "\", "
"\"description\": \""
+ escapeJSON(ppFDesc->getDescription())
+ "\"}, ");
}
}
}
++nCurIndex;
}
nLen = aPayload.getLength();
aPayload[nLen - 2] = ' ';
aPayload[nLen - 1] = ']';
aPayload.append(" }");
OString s = aPayload.makeStringAndClear();
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CALC_FUNCTION_LIST, s);
}
} // end namespace
void ScCellShell::Execute( SfxRequest& rReq )
{
ScTabViewShell* pTabViewShell = GetViewData().GetViewShell();
@@ -416,24 +319,12 @@ void ScCellShell::Execute( SfxRequest& rReq )
break;
case SID_OPENDLG_FUNCTION:
{
const SfxViewShell* pViewShell = SfxViewShell::Current();
if (comphelper::LibreOfficeKit::isActive()
&& pViewShell && pViewShell->isLOKMobilePhone())
{
// not set the dialog id in the mobile case or we would
// not be able to get cell address pasted in the edit view
// by just tapping on them
lcl_lokGetWholeFunctionList();
}
else
{
sal_uInt16 nId = SID_OPENDLG_FUNCTION;
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
bool bVis = comphelper::LibreOfficeKit::isActive() || pWnd == nullptr;
pScMod->SetRefDialog( nId, bVis );
}
rReq.Ignore();
}
break;
+1 -17
View File
@@ -1846,21 +1846,6 @@ bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, bool bAction )
void ScGridWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
if (SfxLokHelper::getDeviceFormFactor() == LOKDeviceFormFactor::MOBILE)
{
ScViewFunc* pView = mrViewData.GetView();
ScTabViewShell* pViewShell = mrViewData.GetViewShell();
bool bRefMode = pViewShell && pViewShell->IsRefInputMode();
Point aPos(rMEvt.GetPosPixel());
SCCOL nPosX;
SCROW nPosY;
mrViewData.GetPosFromPixel(aPos.X(), aPos.Y(), eWhich, nPosX, nPosY);
if (bRefMode && pView->GetFunctionSet().CheckRefBounds(nPosX, nPosY))
return;
}
nNestedButtonState = ScNestedButtonState::Down;
MouseEventState aState;
@@ -2750,8 +2735,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
// On a mobile device view there is no ctrl+click and for hyperlink popup
// the cell coordinates must be sent along with click position for elegance
ScTabViewShell* pViewShell = mrViewData.GetViewShell();
if (isTiledRendering && pViewShell &&
(pViewShell->isLOKMobilePhone() || pViewShell->isLOKTablet()))
if (isTiledRendering && pViewShell && pViewShell->isLOKTablet())
{
aPos = rMEvt.GetPosPixel();
mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
+1 -2
View File
@@ -486,7 +486,7 @@ bool ScViewFunctionSet::SetCursorAtCell( SCCOL nPosX, SCROW nPosY, bool bScroll
if (bRefMode)
{
// if no input is possible from this doc, don't move the reference cursor around
if ( !ScModule::get()->IsModalMode(m_rViewData.GetSfxDocShell()) && (!CheckRefBounds(nPosX, nPosY) || SfxLokHelper::getDeviceFormFactor() != LOKDeviceFormFactor::MOBILE))
if ( !ScModule::get()->IsModalMode(m_rViewData.GetSfxDocShell()) && !CheckRefBounds(nPosX, nPosY))
{
if (!m_bAnchor)
{
@@ -494,7 +494,6 @@ bool ScViewFunctionSet::SetCursorAtCell( SCCOL nPosX, SCROW nPosY, bool bScroll
pView->InitRefMode( nPosX, nPosY, m_rViewData.CurrentTabForData(), SC_REFTYPE_REF );
}
if(SfxLokHelper::getDeviceFormFactor() != LOKDeviceFormFactor::MOBILE)
pView->UpdateRef( nPosX, nPosY, m_rViewData.CurrentTabForData() );
pView->SelectionChanged();
-3
View File
@@ -424,12 +424,9 @@ std::shared_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
break;
}
case SID_OPENDLG_FUNCTION:
{
if (!isLOKMobilePhone())
{
// dialog checks, what is in the cell
xResult = std::make_shared<ScFormulaDlg>(pB, pCW, pParent, GetViewData(), ScGlobal::GetStarCalcFunctionMgr());
}
break;
}
case WID_CONDFRMT_REF:
+1 -2
View File
@@ -760,9 +760,8 @@ bool ScViewFunc::PasteDataFormatFormattedText( SotClipboardFormatId nFormatId,
&& rDataHelper.GetString( nFormatId, *pStrBuffer ))
{
// Do CSV dialog if more than one line. But not if invoked from Automation.
const SfxViewShell* pViewShell = SfxViewShell::Current();
sal_Int32 nDelim = pStrBuffer->indexOf('\n');
if (!(pViewShell && pViewShell->isLOKMobilePhone()) && !comphelper::Automation::AutomationInvokedZone::isActive()
if (!comphelper::Automation::AutomationInvokedZone::isActive()
&& nDelim >= 0 && nDelim != pStrBuffer->getLength () - 1)
{
vcl::Window* pParent = GetActiveWin();
+1 -1
View File
@@ -2718,7 +2718,7 @@ OUString SdPage::GetPresObjText(PresObjKind eObjKind) const
#else
bool isMobileDevice = false;
if (const SfxViewShell* pCurrentViewShell = SfxViewShell::Current())
isMobileDevice = pCurrentViewShell->isLOKMobilePhone() || pCurrentViewShell->isLOKTablet();
isMobileDevice = pCurrentViewShell->isLOKTablet();
#endif
if (eObjKind == PresObjKind::Title)
@@ -90,7 +90,7 @@ namespace sd {
SdPropertySubControl::SdPropertySubControl(weld::Container* pParent)
: mxBuilder(Application::CreateBuilder(pParent, u"modules/simpress/ui/customanimationfragment.ui"_ustr,
false, reinterpret_cast<sal_uInt64>(SfxViewShell::Current())))
reinterpret_cast<sal_uInt64>(SfxViewShell::Current())))
, mxContainer(mxBuilder->weld_container(u"EffectFragment"_ustr))
, mpParent(pParent)
{
+1 -1
View File
@@ -525,7 +525,7 @@ void FuText::ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj)
pTxtObj->SetMergedItemSet(aSet);
pTxtObj->AdjustTextFrameWidthAndHeight();
const SfxViewShell* pCurrentViewShell = SfxViewShell::Current();
if (pCurrentViewShell && (pCurrentViewShell->isLOKMobilePhone() || pCurrentViewShell->isLOKTablet()))
if (pCurrentViewShell && (pCurrentViewShell->isLOKTablet()))
pTxtObj->SetText(SdResId(STR_PRESOBJ_TEXT_EDIT_MOBILE));
}
else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
+1 -14
View File
@@ -1020,22 +1020,9 @@ OString Int32Payload(sal_uInt16, SfxViewFrame*, const css::frame::FeatureStateEv
return aBuffer.makeStringAndClear();
}
OString TransformPayload(sal_uInt16 nSID, SfxViewFrame* pViewFrame,
OString TransformPayload(sal_uInt16, SfxViewFrame*,
const css::frame::FeatureStateEvent& aEvent, const SfxPoolItem*)
{
if (aEvent.IsEnabled && pViewFrame->GetViewShell()->isLOKMobilePhone())
{
boost::property_tree::ptree aTree;
boost::property_tree::ptree aState;
aTree.put("commandName", aEvent.FeatureURL.Complete);
pViewFrame->GetBindings().QueryControlState(nSID, aState);
aTree.add_child("state", aState);
std::stringstream aStream;
boost::property_tree::write_json(aStream, aTree);
return OString(aStream.str());
}
return aEvent.FeatureURL.Complete.toUtf8() + "="; // Should an empty string be returned?
}
+1 -9
View File
@@ -34,16 +34,8 @@ css::uno::Reference< css::frame::XFrame > SfxTabPage::GetFrame() const
return mxFrame;
}
static bool isLOKMobilePhone()
{
if (!comphelper::LibreOfficeKit::isActive())
return false;
const SfxViewShell* pCurrentShell = SfxViewShell::Current();
return pCurrentShell && pCurrentShell->isLOKMobilePhone();
}
SfxTabPage::SfxTabPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OUString& rID, const SfxItemSet *rAttrSet)
: BuilderPage(pPage, pController, rUIXMLDescription, rID, isLOKMobilePhone())
: BuilderPage(pPage, pController, rUIXMLDescription, rID)
, mpSet(rAttrSet)
, mbHasExchangeSupport(false)
, mbCancel(false)
+1 -9
View File
@@ -203,17 +203,9 @@ void SfxModelessDialogController::Close()
SfxDialogController::Close();
}
static bool isLOKMobilePhone()
{
if (!comphelper::LibreOfficeKit::isActive())
return false;
const SfxViewShell* pCurrentShell = SfxViewShell::Current();
return pCurrentShell && pCurrentShell->isLOKMobilePhone();
}
SfxDialogController::SfxDialogController(weld::Widget* pParent, const OUString& rUIFile,
const OUString& rDialogId)
: GenericDialogController(pParent, rUIFile, rDialogId, isLOKMobilePhone())
: GenericDialogController(pParent, rUIFile, rDialogId)
{
m_xDialog->SetInstallLOKNotifierHdl(LINK(this, SfxDialogController, InstallLOKNotifierHdl));
m_xDialog->connect_container_focus_changed(LINK(this, SfxDialogController, FocusChangeHdl));
-7
View File
@@ -241,13 +241,6 @@ void Deck::RequestLayout()
aParentSize.setHeight(mnMinimalHeight);
bChangeNeeded = true;
}
const SfxViewShell* pViewShell = SfxViewShell::Current();
if (mnMinimalWidth > 0 && (mnMinimalWidth != aParentSize.Width() || GetSizePixel().Width() != mnMinimalWidth)
&& pViewShell && pViewShell->isLOKMobilePhone())
{
aParentSize.setWidth(mnMinimalWidth);
bChangeNeeded = true;
}
if (bChangeNeeded)
{
+1 -1
View File
@@ -50,7 +50,7 @@ Panel::Panel(const PanelDescriptor& rPanelDescriptor,
Deck* pDeck,
std::function<Context()> aContextAccess,
const css::uno::Reference<css::frame::XFrame>& rxFrame)
: mxBuilder(Application::CreateBuilder(pParentWindow, u"sfx/ui/panel.ui"_ustr, false, reinterpret_cast<sal_uInt64>(SfxViewShell::Current())))
: mxBuilder(Application::CreateBuilder(pParentWindow, u"sfx/ui/panel.ui"_ustr, reinterpret_cast<sal_uInt64>(SfxViewShell::Current())))
, msPanelId(rPanelDescriptor.msId)
, msTitle(rPanelDescriptor.msTitle)
, mbIsTitleBarOptional(rPanelDescriptor.mbIsTitleBarOptional)
+1 -1
View File
@@ -28,7 +28,7 @@ PanelLayout::PanelLayout(weld::Widget* pParent, const OUString& rID,
PanelLayout::PanelLayout(weld::Widget* pParent, const OUString& rID,
const OUString& rUIXMLDescription, sal_uInt64 nWindowId)
: m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription, false, nWindowId))
: m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription, nWindowId))
, m_xContainer(m_xBuilder->weld_container(rID))
, m_pPanel(nullptr)
{
+1 -11
View File
@@ -1227,17 +1227,7 @@ void SidebarController::RequestCloseDeck()
if (comphelper::LibreOfficeKit::isActive() && mpCurrentDeck)
{
const SfxViewShell* pViewShell = SfxViewShell::Current();
if (pViewShell && pViewShell->isLOKMobilePhone())
{
// Mobile phone - TODO: unify with desktop
tools::JsonWriter aJsonWriter;
aJsonWriter.put("id", mpParentWindow->get_id());
aJsonWriter.put("type", "dockingwindow");
aJsonWriter.put("text", mpParentWindow->GetText());
aJsonWriter.put("enabled", false);
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, aJsonWriter.finishAndGetAsOString());
}
else if (pViewShell)
if (pViewShell)
{
tools::JsonWriter aJsonWriter;
aJsonWriter.put("id", mpParentWindow->get_id());
-2
View File
@@ -460,8 +460,6 @@ void SfxLokHelper::setDeviceFormFactor(std::u16string_view rDeviceFormFactor)
g_deviceFormFactor = LOKDeviceFormFactor::DESKTOP;
else if (rDeviceFormFactor == u"tablet")
g_deviceFormFactor = LOKDeviceFormFactor::TABLET;
else if (rDeviceFormFactor == u"mobile")
g_deviceFormFactor = LOKDeviceFormFactor::MOBILE;
else
g_deviceFormFactor = LOKDeviceFormFactor::UNKNOWN;
}
-8
View File
@@ -35,14 +35,6 @@ svx/uiconfig/ui/findreplacedialog.ui://GtkLabel[@id='label7'] orphan-label
svx/uiconfig/ui/findreplacedialog.ui://GtkRadioButton[@id='rows'] labelled-by-and-mnemonic
svx/uiconfig/ui/floatingcontour.ui://GtkLabel[@id='statuspos'] orphan-label
svx/uiconfig/ui/floatingcontour.ui://GtkLabel[@id='statussize'] orphan-label
svx/uiconfig/ui/findreplacedialog-mobile.ui://GtkLabel[@id='label4'] orphan-label
svx/uiconfig/ui/findreplacedialog-mobile.ui://GtkLabel[@id='searchdesc'] orphan-label
svx/uiconfig/ui/findreplacedialog-mobile.ui://GtkLabel[@id='entirecells'] orphan-label
svx/uiconfig/ui/findreplacedialog-mobile.ui://GtkLabel[@id='label5'] orphan-label
svx/uiconfig/ui/findreplacedialog-mobile.ui://GtkLabel[@id='replacedesc'] orphan-label
svx/uiconfig/ui/findreplacedialog-mobile.ui://GtkLabel[@id='label7'] orphan-label
svx/uiconfig/ui/findreplacedialog-mobile.ui://GtkLabel[@id='searchinlabel'] orphan-label
svx/uiconfig/ui/findreplacedialog-mobile.ui://GtkComboBoxText[@id='calcsearchin'] no-labelled-by
svx/uiconfig/ui/fontworkgallerydialog.ui://GtkLabel[@id='label1'] orphan-label
svx/uiconfig/ui/grafctrlbox.ui://GtkSpinButton[@id='spinfield'] no-labelled-by
svx/uiconfig/ui/imapdialog.ui://GtkLabel[@id='statusurl'] orphan-label
@@ -1538,7 +1538,6 @@ gb_emscripten_fs_image_files += \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/filtermenu.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/filternavigator.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/findbox.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/findreplacedialog-mobile.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/findreplacedialog.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/floatingareastyle.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/floatingcontour.ui \
-1
View File
@@ -55,7 +55,6 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/filternavigator \
svx/uiconfig/ui/findbox \
svx/uiconfig/ui/findreplacedialog \
svx/uiconfig/ui/findreplacedialog-mobile \
svx/uiconfig/ui/floatingareastyle \
svx/uiconfig/ui/floatingcontour \
svx/uiconfig/ui/floatingframeborder \
+1 -19
View File
@@ -86,15 +86,6 @@ using namespace com::sun::star::uno;
using namespace com::sun::star;
using namespace comphelper;
static bool IsMobile()
{
if (!comphelper::LibreOfficeKit::isActive())
return false;
SfxViewShell* pCurrent = SfxViewShell::Current();
return pCurrent && pCurrent->isLOKMobilePhone();
}
enum class ModifyFlags {
NONE = 0x000000,
Search = 0x000001,
@@ -244,7 +235,7 @@ void SearchAttrItemList::Remove(size_t nPos)
SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind)
: SfxModelessDialogController(&rBind, pChildWin, pParent,
IsMobile() ? u"svx/ui/findreplacedialog-mobile.ui"_ustr : u"svx/ui/findreplacedialog.ui"_ustr,
u"svx/ui/findreplacedialog.ui"_ustr,
u"FindReplaceDialog"_ustr)
, m_rBindings(rBind)
, m_aPresentIdle("Bring SvxSearchDialog to Foreground")
@@ -324,9 +315,6 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWi
m_xSearchAttrText->hide();
this->SetSearchLabel(u""_ustr); // hide the message but keep the box height
//weird findreplacedialog-mobile.ui case doesn't have searchicon or searchbox
if (m_xSearchIcon)
m_xSearchIcon->set_size_request(24, 24); // vcl/res/infobar.png is 32x32 - too large here
m_xReplaceTmplLB->make_sorted();
@@ -573,8 +561,6 @@ void SvxSearchDialog::SetSearchLabel(const OUString& rStr)
if (!rStr.isEmpty())
{
m_xSearchLabel->show();
if (m_xSearchIcon)
{
m_xSearchIcon->show();
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
if (rStyleSettings.GetDialogColor().IsDark())
@@ -582,18 +568,14 @@ void SvxSearchDialog::SetSearchLabel(const OUString& rStr)
else
m_xSearchBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as InfobarType::INFO
}
}
else
{
m_xSearchLabel->hide();
if (m_xSearchIcon)
{
const Size aSize = m_xSearchBox->get_preferred_size();
m_xSearchIcon->hide();
m_xSearchBox->set_size_request(-1, aSize.Height());
m_xSearchBox->set_background(COL_TRANSPARENT);
}
}
if (rStr == SvxResId(RID_SVXSTR_SEARCH_NOT_FOUND))
m_xSearchLB->set_entry_message_type(weld::EntryMessageType::Error);
@@ -65,12 +65,6 @@ TextPropertyPanel::TextPropertyPanel(weld::Widget* pParent, const css::uno::Refe
, mxSpacingBar(m_xBuilder->weld_toolbar(u"spacingbar"_ustr))
, mxSpacingBarDispatch(new ToolbarUnoDispatcher(*mxSpacingBar, *m_xBuilder, rxFrame))
{
bool isMobilePhone = false;
const SfxViewShell* pViewShell = SfxViewShell::Current();
if (comphelper::LibreOfficeKit::isActive() &&
pViewShell && pViewShell->isLOKMobilePhone())
isMobilePhone = true;
mxSpacingBar->set_visible(!isMobilePhone);
}
TextPropertyPanel::~TextPropertyPanel()
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1002,7 +1002,7 @@ namespace sw::mark
if (!comphelper::LibreOfficeKit::isActive())
return;
if (!pViewShell || pViewShell->isLOKMobilePhone())
if (!pViewShell)
return;
if (m_aPortionPaintArea.IsEmpty())
@@ -28,14 +28,6 @@
#include <svl/itemset.hxx>
#include <vcl/weld/Builder.hxx>
static bool isLOKMobilePhone()
{
if (!comphelper::LibreOfficeKit::isActive())
return false;
SfxViewShell* pCurrent = SfxViewShell::Current();
return pCurrent && pCurrent->isLOKMobilePhone();
}
SwWatermarkDialog::SwWatermarkDialog(weld::Window* pParent, SfxBindings& rBindings)
: SfxDialogController(pParent, u"modules/swriter/ui/watermarkdialog.ui"_ustr, u"WatermarkDialog"_ustr)
, m_rBindings(rBindings)
@@ -47,14 +39,6 @@ SwWatermarkDialog::SwWatermarkDialog(weld::Window* pParent, SfxBindings& rBindin
, m_xColor(new ColorListBox(m_xBuilder->weld_menu_button(u"Color"_ustr), [this]{ return m_xDialog.get(); }))
{
InitFields();
if (isLOKMobilePhone())
{
m_xBuilder->weld_label(u"ColorLabel"_ustr)->hide();
m_xColor->hide();
m_xBuilder->weld_button(u"cancel"_ustr)->hide();
m_xBuilder->weld_button(u"help"_ustr)->hide();
}
}
SwWatermarkDialog::~SwWatermarkDialog()
@@ -40,7 +40,6 @@ namespace sw::sidebar
AccessibilityCheckEntry::AccessibilityCheckEntry(
weld::Container* pParent, std::shared_ptr<sfx::AccessibilityIssue> const& rAccessibilityIssue)
: m_xBuilder(Application::CreateBuilder(pParent, u"svx/ui/accessibilitycheckentry.ui"_ustr,
false,
reinterpret_cast<sal_uInt64>(SfxViewShell::Current())))
, m_xContainer(m_xBuilder->weld_container(u"accessibilityCheckEntryBox"_ustr))
, m_xLabel(m_xBuilder->weld_label(u"accessibilityCheckEntryLabel"_ustr))
@@ -97,7 +96,6 @@ IMPL_LINK_NOARG(AccessibilityCheckEntry, FixButtonClicked, weld::Button&, void)
AccessibilityCheckLevel::AccessibilityCheckLevel(weld::Box* pParent,
css::uno::Reference<css::ui::XSidebar> xSidebar)
: m_xBuilder(Application::CreateBuilder(pParent, u"svx/ui/accessibilitychecklevel.ui"_ustr,
false,
reinterpret_cast<sal_uInt64>(SfxViewShell::Current())))
, m_xContainer(m_xBuilder->weld_box(u"accessibilityCheckLevelBox"_ustr))
, m_xSidebar(std::move(xSidebar))
+1 -1
View File
@@ -16,7 +16,7 @@ namespace jsdialog
{
/// used to not warn about it
bool isIgnored(std::u16string_view rUIFile);
bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile);
bool isBuilderEnabled(std::u16string_view rUIFile);
bool isBuilderEnabledForPopup(std::u16string_view rUIFile);
bool isBuilderEnabledForMenu(std::u16string_view rUIFile);
bool isBuilderEnabledForSidebar(std::u16string_view rUIFile);
+1 -16
View File
@@ -42,14 +42,6 @@ constexpr auto IgnoredList
{ u"sfx/ui/quickfind.ui" },
});
// ========== MOBILE DIALOGS ================================================= //
constexpr auto MobileDialogList
= frozen::make_unordered_set<std::u16string_view>({
{ u"modules/swriter/ui/watermarkdialog.ui" },
{ u"svx/ui/findreplacedialog-mobile.ui" }
});
// ========== DIALOGS ======================================================= //
// Split into few - to allow constexpr and manage order
@@ -560,15 +552,8 @@ bool isIgnored(std::u16string_view rUIFile)
return isInMap(IgnoredList, rUIFile);
}
bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile)
bool isBuilderEnabled(std::u16string_view rUIFile)
{
// mobile only dialogs
if (bMobile)
{
if (isInMap(MobileDialogList, rUIFile))
return true;
}
if (isInMap(CuiDialogList, rUIFile))
return true;
+2 -2
View File
@@ -39,8 +39,8 @@ DialogController::~DialogController() {}
Dialog* GenericDialogController::getDialog() { return m_xDialog.get(); }
GenericDialogController::GenericDialogController(weld::Widget* pParent, const OUString& rUIFile,
const OUString& rDialogId, bool bMobile)
: m_xBuilder(Application::CreateBuilder(pParent, rUIFile, bMobile))
const OUString& rDialogId)
: m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
, m_xDialog(m_xBuilder->weld_dialog(rDialogId))
{
}
+2 -2
View File
@@ -26,9 +26,9 @@
#include <vcl/weld/weldutils.hxx>
BuilderPage::BuilderPage(weld::Widget* pParent, weld::DialogController* pController,
const OUString& rUIXMLDescription, const OUString& rID, bool bIsMobile)
const OUString& rUIXMLDescription, const OUString& rID)
: m_pDialogController(pController)
, m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription, bIsMobile))
, m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription))
, m_xContainer(m_xBuilder->weld_container(rID))
{
}
+2 -2
View File
@@ -266,7 +266,7 @@ void Application::UICoverageReport(tools::JsonWriter& rJson,
}
}
std::unique_ptr<weld::Builder> Application::CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, bool bMobile, sal_uInt64 nLOKWindowId)
std::unique_ptr<weld::Builder> Application::CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, sal_uInt64 nLOKWindowId)
{
SalInstance* pSalInstance = GetSalInstance();
@@ -285,7 +285,7 @@ std::unique_ptr<weld::Builder> Application::CreateBuilder(weld::Widget* pParent,
return JSInstanceBuilder::CreateSidebarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, "navigator", nLOKWindowId);
else if (jsdialog::isBuilderEnabledForQuickFind(rUIFile))
return JSInstanceBuilder::CreateSidebarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, "quickfind", nLOKWindowId);
else if (jsdialog::isBuilderEnabled(rUIFile, bMobile))
else if (jsdialog::isBuilderEnabled(rUIFile))
return JSInstanceBuilder::CreateDialogBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile);
// this is notebookbar widget but converted from sidebar panel
else if (jsdialog::isInterimBuilderEnabledForNotebookbar(rUIFile))