зеркало из https://github.com/mozilla/gecko-dev.git
Fix bug 279270: remove unused code adding nsICommandParams to cmd_copyImageContents. Also fix warning relating to calling closeTab on a tab view item.
This commit is contained in:
Родитель
78d49ceca1
Коммит
ce1d1ac7b8
|
@ -59,6 +59,7 @@
|
|||
- (void)updateTabVisibility:(BOOL)nowVisible;
|
||||
- (NSView*)tabItemContentsView;
|
||||
- (int)tag;
|
||||
- (void)closeTab:(id)sender;
|
||||
- (void)setTabIcon:(NSImage *)newIcon isDraggable:(BOOL)draggable;
|
||||
- (TruncatingTextAndImageCell *)labelCell;
|
||||
- (TabButtonCell *)tabButtonCell;
|
||||
|
|
|
@ -343,7 +343,7 @@ const int kMenuTruncationChars = 60;
|
|||
[mCloseButton setBordered:NO];
|
||||
[mCloseButton setButtonType:NSMomentaryChangeButton];
|
||||
[mCloseButton setTarget:self];
|
||||
[mCloseButton setAction:@selector(closeTab)];
|
||||
[mCloseButton setAction:@selector(closeTab:)];
|
||||
[mCloseButton setAutoresizingMask:NSViewMinXMargin];
|
||||
|
||||
// create a menu item, to be used when there are more tabs than screen real estate. keep a strong ref
|
||||
|
@ -391,7 +391,7 @@ const int kMenuTruncationChars = 60;
|
|||
return mTag;
|
||||
}
|
||||
|
||||
- (void)closeTab
|
||||
- (void)closeTab:(id)sender
|
||||
{
|
||||
[[self view] windowClosed];
|
||||
[[self tabView] removeTabViewItem:self];
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#import "BrowserWrapper.h"
|
||||
#import "PreferenceManager.h"
|
||||
#import "BrowserTabView.h"
|
||||
#import "BrowserTabViewItem.h"
|
||||
#import "UserDefaults.h"
|
||||
#import "PageProxyIcon.h"
|
||||
#import "AutoCompleteTextField.h"
|
||||
|
@ -2659,7 +2660,7 @@ enum BWCOpenDest {
|
|||
int closeIndex = [urlArray count];
|
||||
int closeCount = [mTabBrowser numberOfTabViewItems] - closeIndex;
|
||||
for (int i = 0; i < closeCount; i++) {
|
||||
[[mTabBrowser tabViewItemAtIndex:closeIndex] closeTab];
|
||||
[(BrowserTabViewItem*)[mTabBrowser tabViewItemAtIndex:closeIndex] closeTab:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2975,19 +2976,11 @@ enum BWCOpenDest {
|
|||
- (IBAction)copyImage:(id)sender
|
||||
{
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser = getter_AddRefs([[[self getBrowserWrapper] getBrowserView] getWebBrowser]);
|
||||
|
||||
// nsIClipboardCommands::CopyImageContents() copies both the location and the image
|
||||
// by default, which we don't want. Thus we need to go directly to the command manger
|
||||
// to send the command with params to just copy the image.
|
||||
nsCOMPtr<nsICommandManager> commandMgr(do_GetInterface(webBrowser));
|
||||
if (!commandMgr)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsICommandParams> params = do_CreateInstance(NS_COMMAND_PARAMS_CONTRACTID);
|
||||
if (params)
|
||||
params->SetLongValue("imageCopy", nsIContentViewerEdit::COPY_IMAGE_DATA);
|
||||
|
||||
(void)commandMgr->DoCommand("cmd_copyImageContents", params, nsnull);
|
||||
(void)commandMgr->DoCommand("cmd_copyImageContents", nsnull, nsnull);
|
||||
}
|
||||
|
||||
- (IBAction)copyImageLocation:(id)sender
|
||||
|
|
Загрузка…
Ссылка в новой задаче