summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-21 09:58:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-21 11:31:26 +0000
commiteeccf1be6a5752b2288086d1f52c1b1e3e5c4137 (patch)
treedfbf82ea03435bf7ab23ba22ddb89867c073beec
parent7cb5b2117429c6c5b12cd2ee4925e0eea18375be (diff)
Related: fdo#88562 Nothing actually sets ID_FILETP_READONLY or ID_FILETP_TITLE
so docs cannot be toggled r/o r/w from properties page or the file name changed. Unkink the logic a bit based on that and move now static widget settings to .ui and remove unused checkbox Change-Id: Ic55e41be8ffd02e214a233a2eb90736c070b5418
-rw-r--r--include/sfx2/dinfdlg.hxx1
-rw-r--r--include/sfx2/sfxsids.hrc4
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx48
-rw-r--r--sfx2/uiconfig/ui/documentinfopage.ui75
4 files changed, 62 insertions, 66 deletions
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 2f481e8cfaac..ecf71c43adfe 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -184,7 +184,6 @@ private:
PushButton* m_pChangePassBtn;
SelectableFixedText* m_pShowTypeFT;
- CheckBox* m_pReadOnlyCB;
FixedText* m_pFileValFt;
SelectableFixedText* m_pShowSizeFT;
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 7ed255a5d805..a0f72b7526bb 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -159,10 +159,6 @@
#define SID_EXPLORER_FILEPROPS_START (SID_SFX_START + 1390)
// SID_EXPLORER_FILEPROPS_END (SID_SFX_START + 1399)
-#define ID_FILETP_START SID_EXPLORER_FILEPROPS_START
-#define ID_FILETP_READONLY (ID_FILETP_START + 0)
-#define ID_FILETP_TITLE (ID_FILETP_START + 1)
-
#define SID_ATTR_ZOOM (SID_SVX_START + 0)
#define SID_EXPLORER_PROPS_START (SID_SFX_START + 1410)
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index a64c637db3c4..487dab7552ad 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -751,11 +751,9 @@ SfxDocumentPage::SfxDocumentPage(vcl::Window* pParent, const SfxItemSet& rItemSe
{
get(m_pBmp, "icon");
get(m_pNameED, "nameed");
-//FIXME m_pNameED->SetAccessibleName( SfxResId( EDIT_FILE_NAME ).toString() );
get(m_pChangePassBtn, "changepass");
get(m_pShowTypeFT, "showtype");
- get(m_pReadOnlyCB, "readonlycb");
get(m_pFileValFt, "showlocation");
get(m_pShowSizeFT, "showsize");
m_aUnknownSize = m_pShowSizeFT->GetText();
@@ -910,8 +908,6 @@ SfxTabPage* SfxDocumentPage::Create( vcl::Window* pParent, const SfxItemSet* rIt
return new SfxDocumentPage( pParent, *rItemSet );
}
-
-
void SfxDocumentPage::EnableUseUserData()
{
bEnableUseUserData = true;
@@ -919,8 +915,6 @@ void SfxDocumentPage::EnableUseUserData()
m_pDeleteBtn->Show();
}
-
-
bool SfxDocumentPage::FillItemSet( SfxItemSet* rSet )
{
bool bRet = false;
@@ -963,23 +957,9 @@ bool SfxDocumentPage::FillItemSet( SfxItemSet* rSet )
}
}
- if ( m_pNameED->IsModified() && !m_pNameED->GetText().isEmpty() )
- {
- rSet->Put( SfxStringItem( ID_FILETP_TITLE, m_pNameED->GetText() ) );
- bRet = true;
- }
-
- if ( /* m_pReadOnlyCB->IsModified() */ true )
- {
- rSet->Put( SfxBoolItem( ID_FILETP_READONLY, m_pReadOnlyCB->IsChecked() ) );
- bRet = true;
- }
-
return bRet;
}
-
-
void SfxDocumentPage::Reset( const SfxItemSet* rSet )
{
// Determine the document information
@@ -1006,33 +986,13 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
}
// determine name
- OUString aName;
- const SfxPoolItem* pItem = 0;
- if ( SfxItemState::SET != rSet->GetItemState( ID_FILETP_TITLE, false, &pItem ) )
- {
- INetURLObject aURL(aFile);
- aName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET );
- if ( aName.isEmpty() || aURL.GetProtocol() == INET_PROT_PRIVATE )
- aName = SfxResId( STR_NONAME ).toString();
- m_pNameED->SetReadOnly( true );
- }
- else
- {
- DBG_ASSERT( pItem->IsA( TYPE( SfxStringItem ) ), "SfxDocumentPage:<SfxStringItem> expected" );
- aName = static_cast<const SfxStringItem*>( pItem )->GetValue();
- }
+ INetURLObject aURL(aFile);
+ OUString aName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET );
+ if ( aName.isEmpty() || aURL.GetProtocol() == INET_PROT_PRIVATE )
+ aName = SfxResId( STR_NONAME ).toString();
m_pNameED->SetText( aName );
- m_pNameED->ClearModifyFlag();
-
- // determine RO-Flag
- if ( SfxItemState::UNKNOWN == rSet->GetItemState( ID_FILETP_READONLY, false, &pItem )
- || !pItem )
- m_pReadOnlyCB->Hide();
- else
- m_pReadOnlyCB->Check( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
// determine context symbol
- INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
aURL.SetSmartURL( aFactory);
const OUString& rMainURL = aURL.GetMainURL( INetURLObject::NO_DECODE );
diff --git a/sfx2/uiconfig/ui/documentinfopage.ui b/sfx2/uiconfig/ui/documentinfopage.ui
index b3e7831ea156..84d684f7a3e6 100644
--- a/sfx2/uiconfig/ui/documentinfopage.ui
+++ b/sfx2/uiconfig/ui/documentinfopage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkGrid" id="DocumentInfoPage">
@@ -22,6 +22,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -36,6 +38,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -50,6 +54,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -64,6 +70,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">9</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -78,6 +86,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">10</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -92,6 +102,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">11</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -105,6 +117,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -118,6 +132,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -132,6 +148,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">8</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -145,6 +163,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">9</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -158,6 +178,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">10</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -171,6 +193,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">11</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -188,6 +212,7 @@
<property name="left_attach">0</property>
<property name="top_attach">12</property>
<property name="width">2</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -202,6 +227,8 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">12</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -217,6 +244,8 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">8</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -231,6 +260,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -244,6 +275,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -258,6 +291,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -272,6 +307,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -287,6 +324,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -299,6 +338,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -314,22 +355,8 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="readonlycb">
- <property name="label" translatable="yes">_Read-only</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -344,6 +371,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -357,6 +386,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -376,6 +407,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -384,11 +417,14 @@
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
+ <property name="editable">False</property>
<property name="invisible_char">•</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
</object>
@@ -396,6 +432,7 @@
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -407,6 +444,7 @@
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">3</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -433,5 +471,8 @@
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>